We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2144462 commit 918a3fbCopy full SHA for 918a3fb
compiler/src/dotty/tools/dotc/core/TypeComparer.scala
@@ -381,6 +381,9 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
381
// where the subtype relation is true without needing to add a constraint
382
// It's tricky because we might need to either appriximate tp2 by its
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.
387
if (frozenConstraint || alwaysFluid) isSubType(tp1, bounds(tp2).lo)
388
else isSubTypeWhenFrozen(tp1, tp2)
389
alwaysTrue || {
0 commit comments