File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -442,7 +442,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
442
442
// type parameter, we will instantiate `C` to `A` and then fail when comparing
443
443
// with `B[Y]`. To do the right thing, we need to instantiate `C` to the
444
444
// common superclass of `A` and `B`.
445
- recur(tp1.join, tp2)
445
+ inFrozenGadt { recur(tp1.join, tp2) }
446
446
case _ =>
447
447
false
448
448
}
@@ -469,7 +469,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
469
469
widenOK
470
470
|| joinOK
471
471
|| (tp1.isSoft || constrainRHSVars(tp2)) && recur(tp11, tp2) && recur(tp12, tp2)
472
- || containsAnd(tp1) && recur (tp1.join, tp2)
472
+ || containsAnd(tp1) && inFrozenGadt { isSubType (tp1.join, tp2, approx) }
473
473
case tp1 : MatchType =>
474
474
val reduced = tp1.reduced
475
475
if (reduced.exists) recur(reduced, tp2) else thirdTry
You can’t perform that action at this time.
0 commit comments