Skip to content

Commit 558b045

Browse files
Fix #9871: use toNestedPairs in provablyDisjoint
1 parent 66b8a7d commit 558b045

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
@@ -2443,7 +2443,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
24432443
decompose(cls2, tp2).forall(x => provablyDisjoint(x, tp1))
24442444
else
24452445
false
2446-
case (AppliedType(tycon1, args1), AppliedType(tycon2, args2)) if tycon1 == tycon2 =>
2446+
case (AppliedType(tycon1, args1), AppliedType(tycon2, args2)) if isSame(tycon1, tycon2) =>
24472447
// It is possible to conclude that two types applies are disjoint by
24482448
// looking at covariant type parameters if the said type parameters
24492449
// are disjoin and correspond to fields.
@@ -2507,6 +2507,10 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
25072507
case (_, tp2: AndType) =>
25082508
!(tp2 <:< tp1)
25092509
&& (provablyDisjoint(tp1, tp2.tp2) || provablyDisjoint(tp1, tp2.tp1))
2510+
case (tp1: Type, tp2: Type) if defn.isTupleType(tp1) =>
2511+
provablyDisjoint(tp1.toNestedPairs, tp2)
2512+
case (tp1: Type, tp2: Type) if defn.isTupleType(tp2) =>
2513+
provablyDisjoint(tp1, tp2.toNestedPairs)
25102514
case (tp1: TypeProxy, tp2: TypeProxy) =>
25112515
provablyDisjoint(tp1.underlying, tp2) || provablyDisjoint(tp1, tp2.underlying)
25122516
case (tp1: TypeProxy, _) =>

0 commit comments

Comments
 (0)