summaryrefslogtreecommitdiff
path: root/test/files/neg/patmatexhaust.scala
diff options
context:
space:
mode:
authorBurak Emir <emir@epfl.ch>2007-03-22 03:28:30 +0000
committerBurak Emir <emir@epfl.ch>2007-03-22 03:28:30 +0000
commitc61121a813abaace6e739a6f02e4c85b186f95a1 (patch)
tree74e4b0b57269397e888424346f674efcd933efc4 /test/files/neg/patmatexhaust.scala
parent8e890c848ff68e69342d0f340df40f926857c861 (diff)
downloadscala-c61121a813abaace6e739a6f02e4c85b186f95a1.tar.gz
scala-c61121a813abaace6e739a6f02e4c85b186f95a1.tar.bz2
scala-c61121a813abaace6e739a6f02e4c85b186f95a1.zip
new pattern matching algo
removed "removeoption" changed SUnit and some tests added useful debug msg in typer
Diffstat (limited to 'test/files/neg/patmatexhaust.scala')
-rw-r--r--test/files/neg/patmatexhaust.scala8
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 =>
}
+
}