Skip to content

Commit 265dfa1

Browse files
committed
Fix CI
1 parent 795ecf5 commit 265dfa1

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

Diff for: compiler/src/dotty/tools/dotc/transform/patmat/Space.scala

+3-3
Original file line numberDiff line numberDiff 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(tp1, tp2), decomposed = true) :: Nil
606606
}
607607

608608
if canDecompose(tp1) then

Diff for: tests/patmat/i10667.scala

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
}

0 commit comments

Comments
 (0)