Skip to content

Commit 13330ca

Browse files
committed
Fix #12602: Add test
1 parent 9a0182a commit 13330ca

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

compiler/src/dotty/tools/dotc/transform/patmat/Space.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,9 @@ class SpaceEngine(using Context) extends SpaceLogic {
846846

847847
if (!exhaustivityCheckable(sel)) return
848848

849+
debug.println("checking " + _match.show)
850+
debug.println("selTyp = " + selTyp.show)
851+
849852
val patternSpace = Or(cases.foldLeft(List.empty[Space]) { (acc, x) =>
850853
val space = if (x.guard.isEmpty) project(x.pat) else Empty
851854
debug.println(s"${x.pat.show} ====> ${show(space)}")

tests/patmat/i12602.check

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2: Pattern Match Exhaustivity: _: Foo[_]

tests/patmat/i12602.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
sealed class Foo[T]
2+
object Foo extends Foo[Nothing]

0 commit comments

Comments
 (0)