diff options
Diffstat (limited to 'test/files/neg/patmatexhaust.scala')
-rw-r--r-- | test/files/neg/patmatexhaust.scala | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/test/files/neg/patmatexhaust.scala b/test/files/neg/patmatexhaust.scala index aaa32cda24..7370868363 100644 --- a/test/files/neg/patmatexhaust.scala +++ b/test/files/neg/patmatexhaust.scala @@ -27,7 +27,6 @@ class TestSealedExhaustive { // compile only //case {Qult(), Qult()} => } - sealed class Deep case object Ga extends Deep @@ -42,11 +41,11 @@ class TestSealedExhaustive { // compile only case _ => } - def ma4(x:Deep) = x match { // missing cases: Gu + def ma4(x:Deep) = x match { // missing cases: Gu, Gp case Ga => } - def zma5(x:Deep) = x match { // exhaustive + def ma5(x:Deep) = x match { // Gp case Gu => case _ if 1 == 0 => case Ga => @@ -56,6 +55,11 @@ class TestSealedExhaustive { // compile only case List(1,2) => case x :: xs => } + + def ma7 = List(1,2) match { //exhaustive + case 1::2::Nil => + case _ => + } def redundant = 1 match { // include this otherwise script won't test this in files/neg case 1 => case 1 => |