Skip to content

Commit 6eece75

Browse files
committed
Fix to lub: recompute if either operand can be widened
1 parent 7151d0f commit 6eece75

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ class TypeComparer(initctx: Context) extends DotClass {
645645
else {
646646
val tp1w = tp1.widen
647647
val tp2w = tp2.widen
648-
if ((tp1 ne tp1w) && (tp2 ne tp2w)) lub(tp1w, tp2w)
648+
if ((tp1 ne tp1w) || (tp2 ne tp2w)) lub(tp1w, tp2w)
649649
else orType(tp1w, tp2w) // no need to check subtypes again
650650
}
651651
}

0 commit comments

Comments
 (0)