@@ -573,11 +573,11 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] {
573
573
}
574
574
compareTypeLambda
575
575
case OrType (tp21, tp22) =>
576
- val tp1a = tp1.widenDealiasKeepRefiningAnnots
576
+ val tp1w = tp1.widen
577
+ val tp1a = tp1w.dealiasKeepRefiningAnnots
577
578
if (tp1a ne tp1)
578
579
// Follow the alias; this might avoid truncating the search space in the either below
579
- // Note that it's safe to widen here because singleton types cannot be part of `|`.
580
- return recur(tp1a, tp2)
580
+ return recur(tp1a, tp2) || (tp1w ne tp1) && isSubType(tp1w, tp2, approx.addLow)
581
581
582
582
// Rewrite T1 <: (T211 & T212) | T22 to T1 <: (T211 | T22) and T1 <: (T212 | T22)
583
583
// and analogously for T1 <: T21 | (T221 & T222)
@@ -2213,6 +2213,11 @@ class ExplainingTypeComparer(initctx: Context) extends TypeComparer(initctx) {
2213
2213
super .isSubType(tp1, tp2, approx)
2214
2214
}
2215
2215
2216
+ override def recur (tp1 : Type , tp2 : Type ): Boolean =
2217
+ traceIndented(s " ${show(tp1)} <:< ${show(tp2)} recur ${if (frozenConstraint) " frozen" else " " }" ) {
2218
+ super .recur(tp1, tp2)
2219
+ }
2220
+
2216
2221
override def hasMatchingMember (name : Name , tp1 : Type , tp2 : RefinedType ): Boolean =
2217
2222
traceIndented(s " hasMatchingMember( ${show(tp1)} . $name, ${show(tp2.refinedInfo)}), member = ${show(tp1.member(name).info)}" ) {
2218
2223
super .hasMatchingMember(name, tp1, tp2)
0 commit comments