File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -475,12 +475,17 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
475
475
isSubType(tp1.resType, tp2.resType.subst(tp2, tp1))
476
476
finally comparedTypeLambdas = saved
477
477
case _ =>
478
- if (! tp1.isHK) {
479
- tp2 match {
480
- case EtaExpansion (tycon2) if tycon2.symbol.isClass =>
481
- return isSubType(tp1, tycon2)
482
- case _ =>
483
- }
478
+ if (tp1.isHK) {
479
+ val tparams1 = tp1.typeParams
480
+ return isSubType(
481
+ HKTypeLambda .fromParams(tparams1, tp1.appliedTo(tparams1.map(_.paramRef))),
482
+ tp2
483
+ )
484
+ }
485
+ else tp2 match {
486
+ case EtaExpansion (tycon2) if tycon2.symbol.isClass =>
487
+ return isSubType(tp1, tycon2)
488
+ case _ =>
484
489
}
485
490
fourthTry(tp1, tp2)
486
491
}
You can’t perform that action at this time.
0 commit comments