File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -2417,9 +2417,11 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] w
24172417 (provablyDisjoint(tp1.tp1, tp2.tp1) || provablyDisjoint(tp1.tp2, tp2.tp2)) &&
24182418 (provablyDisjoint(tp1.tp1, tp2.tp2) || provablyDisjoint(tp1.tp2, tp2.tp1))
24192419 case (tp1 : AndType , _) =>
2420- provablyDisjoint(tp1.tp2, tp2) || provablyDisjoint(tp1.tp1, tp2)
2420+ ! (tp1 <:< tp2)
2421+ && (provablyDisjoint(tp1.tp2, tp2) || provablyDisjoint(tp1.tp1, tp2))
24212422 case (_, tp2 : AndType ) =>
2422- provablyDisjoint(tp1, tp2.tp2) || provablyDisjoint(tp1, tp2.tp1)
2423+ ! (tp2 <:< tp1)
2424+ && (provablyDisjoint(tp1, tp2.tp2) || provablyDisjoint(tp1, tp2.tp1))
24232425 case (tp1 : TypeProxy , tp2 : TypeProxy ) =>
24242426 provablyDisjoint(tp1.underlying, tp2) || provablyDisjoint(tp1, tp2.underlying)
24252427 case (tp1 : TypeProxy , _) =>
Original file line number Diff line number Diff line change 1+ trait P
12enum Tree [T ] {
2- case True extends Tree [Boolean ]
3- case False extends Tree [Boolean ]
4- case Zero extends Tree [Int ]
5- case Succ (n : Tree [Int ]) extends Tree [Int ]
6- case Pred (n : Tree [Int ]) extends Tree [Int ]
7- case IsZero (n : Tree [Int ]) extends Tree [Boolean ]
3+ case True extends Tree [Boolean ], P
4+ case False extends Tree [Boolean ], P
5+ case Zero extends Tree [Int ], P
6+ case Succ (n : Tree [Int ]) extends Tree [Int ], P
7+ case Pred (n : Tree [Int ]) extends Tree [Int ], P
8+ case IsZero (n : Tree [Int ]) extends Tree [Boolean ], P
89 case If (cond : Tree [Boolean ], thenp : Tree [T ], elsep : Tree [T ])
9- extends Tree [T ]
10+ extends Tree [T ], P
1011}
1112
1213object Test {
You can’t perform that action at this time.
0 commit comments