Skip to content

Commit 10080b9

Browse files
Fix #9871: use toNestedPairs in provablyDisjoint
1 parent 28aa982 commit 10080b9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2449,8 +2449,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
24492449
decompose(cls2, tp2).forall(x => provablyDisjoint(x, tp1))
24502450
else
24512451
false
2452-
case (AppliedType(tycon1, args1), AppliedType(tycon2, args2))
2453-
if tycon1.typeSymbol == tycon2.typeSymbol && tycon1 =:= tycon2 =>
2452+
case (AppliedType(tycon1, args1), AppliedType(tycon2, args2)) if isSame(tycon1, tycon2) =>
24542453
// It is possible to conclude that two types applies are disjoint by
24552454
// looking at covariant type parameters if the said type parameters
24562455
// are disjoin and correspond to fields.
@@ -2520,6 +2519,10 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
25202519
provablyDisjoint(tp1, gadtBounds(tp2.symbol).hi) || provablyDisjoint(tp1, tp2.superType)
25212520
case (tp1: TermRef, tp2: TermRef) if isEnumValueOrModule(tp1) && isEnumValueOrModule(tp2) =>
25222521
tp1.termSymbol != tp2.termSymbol
2522+
case (tp1: Type, tp2: Type) if defn.isTupleType(tp1) =>
2523+
provablyDisjoint(tp1.toNestedPairs, tp2)
2524+
case (tp1: Type, tp2: Type) if defn.isTupleType(tp2) =>
2525+
provablyDisjoint(tp1, tp2.toNestedPairs)
25232526
case (tp1: TypeProxy, tp2: TypeProxy) =>
25242527
provablyDisjoint(tp1.superType, tp2) || provablyDisjoint(tp1, tp2.superType)
25252528
case (tp1: TypeProxy, _) =>

0 commit comments

Comments
 (0)