We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e1d2d56 commit 58f46feCopy full SHA for 58f46fe
compiler/src/dotty/tools/dotc/core/TypeComparer.scala
@@ -475,12 +475,17 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
475
isSubType(tp1.resType, tp2.resType.subst(tp2, tp1))
476
finally comparedTypeLambdas = saved
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
- }
+ if (tp1.isHK) {
+ val tparams1 = tp1.typeParams
+ return isSubType(
+ HKTypeLambda.fromParams(tparams1, tp1.appliedTo(tparams1.map(_.paramRef))),
+ tp2
+ )
484
+ }
485
+ else tp2 match {
486
+ case EtaExpansion(tycon2) if tycon2.symbol.isClass =>
487
+ return isSubType(tp1, tycon2)
488
+ case _ =>
489
}
490
fourthTry(tp1, tp2)
491
0 commit comments