Skip to content

Commit

Permalink
Fix scala#12602: Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
liufengyun committed May 25, 2021
1 parent 9a0182a commit 13330ca
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions compiler/src/dotty/tools/dotc/transform/patmat/Space.scala
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,9 @@ class SpaceEngine(using Context) extends SpaceLogic {

if (!exhaustivityCheckable(sel)) return

debug.println("checking " + _match.show)
debug.println("selTyp = " + selTyp.show)

val patternSpace = Or(cases.foldLeft(List.empty[Space]) { (acc, x) =>
val space = if (x.guard.isEmpty) project(x.pat) else Empty
debug.println(s"${x.pat.show} ====> ${show(space)}")
Expand Down
1 change: 1 addition & 0 deletions tests/patmat/i12602.check
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2: Pattern Match Exhaustivity: _: Foo[_]
2 changes: 2 additions & 0 deletions tests/patmat/i12602.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sealed class Foo[T]
object Foo extends Foo[Nothing]

0 comments on commit 13330ca

Please sign in to comment.