Skip to content

Commit 5636765

Browse files
committed
Generalize condition in TypeComparer
I don't have a test, but it makes more sense this way.
1 parent c2d8fa6 commit 5636765

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler/src/dotty/tools/dotc/ast/Desugar.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ object desugar {
8888
else {
8989
def msg =
9090
s"no matching symbol for ${tp.symbol.showLocated} in ${defctx.owner} / ${defctx.effectiveScope.toList}"
91-
ErrorType(msg).assertingErrorsReported(msg)
92-
}
91+
ErrorType(msg).assertingErrorsReported(msg)
92+
}
9393
case _ =>
9494
mapOver(tp)
9595
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
631631
case EtaExpansion(tycon1) => recur(tycon1, tp2)
632632
case _ => tp2 match {
633633
case tp2: HKTypeLambda => false // this case was covered in thirdTry
634-
case _ => tp2.isLambdaSub && isSubType(tp1.resultType, tp2.appliedTo(tp1.paramRefs))
634+
case _ => tp2.typeParams.hasSameLengthAs(tp1.paramRefs) && isSubType(tp1.resultType, tp2.appliedTo(tp1.paramRefs))
635635
}
636636
}
637637
compareHKLambda

0 commit comments

Comments
 (0)