File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -574,8 +574,15 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
574
574
isNewSubType(tp1.parent, tp2)
575
575
case tp1 @ HKApply (tycon1, args1) =>
576
576
compareHkApply1(tp1, tycon1, args1, tp2)
577
- case EtaExpansion (tycon1) =>
578
- isSubType(tycon1, tp2)
577
+ case tp1 : HKTypeLambda =>
578
+ def compareHKLambda = tp1 match {
579
+ case EtaExpansion (tycon1) => isSubType(tycon1, tp2)
580
+ case _ => tp2 match {
581
+ case tp2 : HKTypeLambda => false // this case was covered in thirdTry
582
+ case _ => tp2.isHK && isSubType(tp1.resultType, tp2.appliedTo(tp1.paramRefs))
583
+ }
584
+ }
585
+ compareHKLambda
579
586
case AndType (tp11, tp12) =>
580
587
// Rewrite (T111 | T112) & T12 <: T2 to (T111 & T12) <: T2 and (T112 | T12) <: T2
581
588
// and analogously for T11 & (T121 | T122) & T12 <: T2
You can’t perform that action at this time.
0 commit comments