Skip to content

Commit 6ea1a7b

Browse files
committed
Drop non-sensical case in provablyDisjoint
Surely, two intersection types A1 & A2 and B1 & B2 are provable disjoint if any pair of A_i and B_j is provably disjoint? This is already handled by the single-side cases for AndTypes. The dropped case imposed a stronger condition.
1 parent 49fc004 commit 6ea1a7b

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2413,9 +2413,6 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] w
24132413
provablyDisjoint(tp1.tp1, tp2) && provablyDisjoint(tp1.tp2, tp2)
24142414
case (_, tp2: OrType) =>
24152415
provablyDisjoint(tp1, tp2.tp1) && provablyDisjoint(tp1, tp2.tp2)
2416-
case (tp1: AndType, tp2: AndType) =>
2417-
(provablyDisjoint(tp1.tp1, tp2.tp1) || provablyDisjoint(tp1.tp2, tp2.tp2)) &&
2418-
(provablyDisjoint(tp1.tp1, tp2.tp2) || provablyDisjoint(tp1.tp2, tp2.tp1))
24192416
case (tp1: AndType, _) =>
24202417
!(tp1 <:< tp2)
24212418
&& (provablyDisjoint(tp1.tp2, tp2) || provablyDisjoint(tp1.tp1, tp2))

0 commit comments

Comments
 (0)