File tree 3 files changed +23
-7
lines changed
compiler/src/dotty/tools/dotc/core
3 files changed +23
-7
lines changed Original file line number Diff line number Diff line change @@ -369,14 +369,18 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
369
369
case _ =>
370
370
val cls2 = tp2.symbol
371
371
if (cls2.isClass) {
372
- val base = tp1.baseType(cls2)
373
- if (base.exists) {
374
- if (cls2.is(JavaDefined ))
375
- // If `cls2` is parameterized, we are seeing a raw type, so we need to compare only the symbol
376
- return base.typeSymbol == cls2
377
- if (base ne tp1) return isSubType(base, tp2)
372
+ if (cls2.typeParams.nonEmpty && tp1.isHK)
373
+ isSubType(tp1, EtaExpansion (cls2.typeRef))
374
+ else {
375
+ val base = tp1.baseType(cls2)
376
+ if (base.exists) {
377
+ if (cls2.is(JavaDefined ))
378
+ // If `cls2` is parameterized, we are seeing a raw type, so we need to compare only the symbol
379
+ return base.typeSymbol == cls2
380
+ if (base ne tp1) return isSubType(base, tp2)
381
+ }
382
+ if (cls2 == defn.SingletonClass && tp1.isStable) return true
378
383
}
379
- if (cls2 == defn.SingletonClass && tp1.isStable) return true
380
384
}
381
385
fourthTry(tp1, tp2)
382
386
}
Original file line number Diff line number Diff line change
1
+ trait Fun [L [_]]
2
+
3
+ object O1 {
4
+ trait N [X ]
5
+ }
6
+
7
+ object O2 {
8
+ def bar : Fun [O1 .N ] = ???
9
+ }
Original file line number Diff line number Diff line change
1
+ object Test {
2
+ def c : Fun [O1 .N ] = O2 .bar
3
+ }
You can’t perform that action at this time.
0 commit comments