diff options
author | Burak Emir <emir@epfl.ch> | 2007-02-05 17:17:17 +0000 |
---|---|---|
committer | Burak Emir <emir@epfl.ch> | 2007-02-05 17:17:17 +0000 |
commit | 2f4f3d3db7c2eb9ed535065ffed8098a99de0278 (patch) | |
tree | d3d8c20356bd8f76d1b4b7aa298507232ae028cb /test/files/neg/patmatexhaust.scala | |
parent | 912077c5f8d59b2585a3a5014c193a8399b672d1 (diff) | |
download | scala-2f4f3d3db7c2eb9ed535065ffed8098a99de0278.tar.gz scala-2f4f3d3db7c2eb9ed535065ffed8098a99de0278.tar.bz2 scala-2f4f3d3db7c2eb9ed535065ffed8098a99de0278.zip |
exhaustivity reworked
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 => |