File tree Expand file tree Collapse file tree 2 files changed +30
-2
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -242,8 +242,9 @@ object Types {
242
242
// If the type is `T | Null` or `T | Nothing`, and `T` derivesFrom the class,
243
243
// then the OrType derivesFrom the class. Otherwise, we need to check both sides
244
244
// derivesFrom the class.
245
- if defn.isBottomType(tp.tp1) then loop(tp.tp2)
246
- else loop(tp.tp1) && (defn.isBottomType(tp.tp2) || loop(tp.tp2))
245
+ loop(tp.tp1) && loop(tp.tp2)
246
+ || tp.tp1.isNullType && loop(tp.tp2)
247
+ || tp.tp2.isNullType && loop(tp.tp2)
247
248
case tp : JavaArrayType =>
248
249
cls == defn.ObjectClass
249
250
case _ =>
Original file line number Diff line number Diff line change
1
+ trait A
2
+ trait B
3
+ trait C
4
+ trait D
5
+ trait E
6
+ trait F
7
+ trait G
8
+ trait H
9
+ trait I
10
+ trait J
11
+ trait K
12
+ trait L
13
+ trait M
14
+ trait N
15
+ trait O
16
+ trait P
17
+ trait Q
18
+ trait R
19
+ trait S
20
+ trait T
21
+ trait U
22
+ trait V
23
+ trait W
24
+
25
+ class Foo [T ]
26
+
27
+ val f = Foo [A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U ]
You can’t perform that action at this time.
0 commit comments