summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorBurak Emir <emir@epfl.ch>2008-01-04 22:28:43 +0000
committerBurak Emir <emir@epfl.ch>2008-01-04 22:28:43 +0000
commit73d091062d346528337bc22badbca932714575cc (patch)
tree90cf949c82827e2afcf6c3462d6ae17e4993e0ea /test/files
parent0fd867b5edf52ba97db80014ba041c901b12a98d (diff)
downloadscala-73d091062d346528337bc22badbca932714575cc.tar.gz
scala-73d091062d346528337bc22badbca932714575cc.tar.bz2
scala-73d091062d346528337bc22badbca932714575cc.zip
fixed t335
Diffstat (limited to 'test/files')
-rw-r--r--test/files/neg/patmatexhaust.check6
-rw-r--r--test/files/run/patmatnew.check14
-rw-r--r--test/files/run/patmatnew.scala13
3 files changed, 31 insertions, 2 deletions
diff --git a/test/files/neg/patmatexhaust.check b/test/files/neg/patmatexhaust.check
index 7cdf43c8ca..2011e4afaf 100644
--- a/test/files/neg/patmatexhaust.check
+++ b/test/files/neg/patmatexhaust.check
@@ -20,8 +20,12 @@ missing combination Gp
def ma4(x:Deep) = x match { // missing cases: Gu, Gp
^
+patmatexhaust.scala:53: warning: match is not exhaustive!
+
+ def ma5(x:Deep) = x match { // Gp
+ ^
patmatexhaust.scala:70: error: unreachable code
case 1 =>
^
-four warnings found
+5 warnings found
one error found
diff --git a/test/files/run/patmatnew.check b/test/files/run/patmatnew.check
index 0747cddefb..a5ad998bc5 100644
--- a/test/files/run/patmatnew.check
+++ b/test/files/run/patmatnew.check
@@ -1,2 +1,14 @@
+patmatnew.scala:526: warning: match is not exhaustive!
+
+ def go(tok : Token) = tok.matching match {
+ ^
+patmatnew.scala:595: warning: match is not exhaustive!
+
+ (None:Option[Boolean]) match {
+ ^
+patmatnew.scala:815: warning: match is not exhaustive!
+
+ (EmptyTree: Tree) match {
+ ^
warning: there were unchecked warnings; re-run with -unchecked for details
-one warning found
+four warnings found
diff --git a/test/files/run/patmatnew.scala b/test/files/run/patmatnew.scala
index f4852b4a0c..3580e561e8 100644
--- a/test/files/run/patmatnew.scala
+++ b/test/files/run/patmatnew.scala
@@ -805,6 +805,19 @@ object Test extends TestConsoleMain {
}
}
}
+
+ sealed abstract class Tree
+ case class Node(l: Tree, v: Int, r: Tree) extends Tree
+ case object EmptyTree extends Tree
+
+ object Ticket335 extends TestCase("#335") { // compile-only
+ override def runTest {
+ (EmptyTree: Tree) match {
+ case Node(_,v,_) if (v == 0) => 0
+ case EmptyTree => 2
+ }
+ }
+ }
}