diff options
author | Burak Emir <emir@epfl.ch> | 2008-01-04 22:28:43 +0000 |
---|---|---|
committer | Burak Emir <emir@epfl.ch> | 2008-01-04 22:28:43 +0000 |
commit | 73d091062d346528337bc22badbca932714575cc (patch) | |
tree | 90cf949c82827e2afcf6c3462d6ae17e4993e0ea /test/files/run | |
parent | 0fd867b5edf52ba97db80014ba041c901b12a98d (diff) | |
download | scala-73d091062d346528337bc22badbca932714575cc.tar.gz scala-73d091062d346528337bc22badbca932714575cc.tar.bz2 scala-73d091062d346528337bc22badbca932714575cc.zip |
fixed t335
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/patmatnew.check | 14 | ||||
-rw-r--r-- | test/files/run/patmatnew.scala | 13 |
2 files changed, 26 insertions, 1 deletions
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 + } + } + } } |