diff options
Diffstat (limited to 'test/files/neg/patmatexhaust.scala')
-rw-r--r-- | test/files/neg/patmatexhaust.scala | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/files/neg/patmatexhaust.scala b/test/files/neg/patmatexhaust.scala index 204bf2f170..b2d0b8ddd2 100644 --- a/test/files/neg/patmatexhaust.scala +++ b/test/files/neg/patmatexhaust.scala @@ -1,5 +1,4 @@ class TestSealedExhaustive { // compile only - sealed class Foo case class Bar(x:Int) extends Foo @@ -20,6 +19,7 @@ class TestSealedExhaustive { // compile only def ma33(x:Kult) = x match { // exhaustive case Kult(_) => // exhaustive } + def ma3(x:Mult) = (x,x) match { // not exhaustive case (Kult(_), Qult()) => // Kult missing //case Pair(Kult(_), Kult(_)) => @@ -27,6 +27,11 @@ class TestSealedExhaustive { // compile only //case Pair(Qult(), Qult()) => } + def ma3u(x:Mult) = ((x,x) : @unchecked) match { // not exhaustive, but not checked! + case (Kult(_), Qult()) => + case (Qult(), Kult(_)) => + } + sealed class Deep case object Ga extends Deep @@ -64,4 +69,5 @@ class TestSealedExhaustive { // compile only case 1 => case 1 => } + } |