Skip to content

Commit 0b3e657

Browse files
committed
Fix scala#2989: HK type Y not considered a subtype of [T] => Y[T]
1 parent 6324124 commit 0b3e657

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

compiler/src/dotty/tools/dotc/core/TypeComparer.scala

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -464,14 +464,12 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
464464
isSubType(tp1.resType, tp2.resType.subst(tp2, tp1))
465465
finally comparedTypeLambdas = saved
466466
case _ =>
467-
if (!tp1.isHK) {
468-
tp2 match {
469-
case EtaExpansion(tycon2) if tycon2.symbol.isClass =>
470-
return isSubType(tp1, tycon2)
471-
case _ =>
472-
}
467+
tp2 match {
468+
case EtaExpansion(tycon2) =>
469+
isSubType(tp1, tycon2)
470+
case _ =>
471+
fourthTry(tp1, tp2)
473472
}
474-
fourthTry(tp1, tp2)
475473
}
476474
compareTypeLambda
477475
case OrType(tp21, tp22) =>

0 commit comments

Comments
 (0)