Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
liufengyun committed May 21, 2021
1 parent 795ecf5 commit ae37dcc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compiler/src/dotty/tools/dotc/transform/patmat/Space.scala
Original file line number Diff line number Diff line change
Expand Up @@ -599,10 +599,10 @@ class SpaceEngine(using Context) extends SpaceLogic {
Typ(tp, decomposed = true) :: Nil
else if tpB <:< tp then
Typ(tpB, decomposed = true) :: Nil
else if TypeComparer.provablyDisjoint(tp, tpB) then
Nil
else
intersectUnrelatedAtomicTypes(tp, tpB) match
case Empty => Nil
case typ: Typ => List(typ)
Typ(AndType(tp, tpB), decomposed = true) :: Nil
}

if canDecompose(tp1) then
Expand Down
15 changes: 15 additions & 0 deletions tests/patmat/i10667.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
sealed trait A

enum Nums {
case One
case Two extends Nums with A
case Three
}

object Test {
val list = List[Nums & A](Nums.Two)

list.map {
case Nums.Two => ()
}
}

0 comments on commit ae37dcc

Please sign in to comment.