File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -381,6 +381,9 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
381
381
// where the subtype relation is true without needing to add a constraint
382
382
// It's tricky because we might need to either appriximate tp2 by its
383
383
// lower bound or else widen tp1 and check that the result is a subtype of tp2.
384
+ // So if the constraint is not yet frozen, we do the same comparison again
385
+ // with a frozen constraint, which means that we get a chance to do the
386
+ // widening in `fourthTry` before adding to the constraint.
384
387
if (frozenConstraint || alwaysFluid) isSubType(tp1, bounds(tp2).lo)
385
388
else isSubTypeWhenFrozen(tp1, tp2)
386
389
alwaysTrue || {
You can’t perform that action at this time.
0 commit comments