File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
compiler/src/dotty/tools/dotc/transform/patmat Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -599,10 +599,10 @@ class SpaceEngine(using Context) extends SpaceLogic {
599599 Typ (tp, decomposed = true ) :: Nil
600600 else if tpB <:< tp then
601601 Typ (tpB, decomposed = true ) :: Nil
602+ else if TypeComparer .provablyDisjoint(tp, tpB) then
603+ Nil
602604 else
603- intersectUnrelatedAtomicTypes(tp, tpB) match
604- case Empty => Nil
605- case typ : Typ => List (typ)
605+ Typ (AndType (tp, tpB), decomposed = true ) :: Nil
606606 }
607607
608608 if canDecompose(tp1) then
Original file line number Diff line number Diff line change 1+ sealed trait A
2+
3+ enum Nums {
4+ case One
5+ case Two extends Nums with A
6+ case Three
7+ }
8+
9+ object Test {
10+ val list = List [Nums & A ](Nums .Two )
11+
12+ list.map {
13+ case Nums .Two => ()
14+ }
15+ }
You can’t perform that action at this time.
0 commit comments