Skip to content

Commit 46ab58b

Browse files
committed
Attempt to fix a potentially missing case in TypeComparer
1 parent dec3404 commit 46ab58b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,11 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] {
451451
// widening in `fourthTry` before adding to the constraint.
452452
if (frozenConstraint) isSubType(tp1, bounds(tp2).lo)
453453
else isSubTypeWhenFrozen(tp1, tp2)
454-
alwaysTrue || {
454+
alwaysTrue ||
455+
frozenConstraint && (tp1 match {
456+
case tp1: TypeParamRef => constraint.isLess(tp1, tp2)
457+
case _ => false
458+
}) || {
455459
if (canConstrain(tp2) && !approx.low)
456460
addConstraint(tp2, tp1.widenExpr, fromBelow = true)
457461
else fourthTry

0 commit comments

Comments
 (0)