diff options
author | Burak Emir <emir@epfl.ch> | 2007-11-25 21:43:44 +0000 |
---|---|---|
committer | Burak Emir <emir@epfl.ch> | 2007-11-25 21:43:44 +0000 |
commit | ccb860372fb7384cd6a8bf3c010d63c51becdcbf (patch) | |
tree | 8c075de7b3fb6e851b4857bf67cd3c9552fb2c77 /test/files | |
parent | 2ee9e59b353536a601cdf71ea14223ee3fff471b (diff) | |
download | scala-ccb860372fb7384cd6a8bf3c010d63c51becdcbf.tar.gz scala-ccb860372fb7384cd6a8bf3c010d63c51becdcbf.tar.bz2 scala-ccb860372fb7384cd6a8bf3c010d63c51becdcbf.zip |
fixes ticket 230, props to Jon Pretty who found...
fixes ticket 230, props to Jon Pretty who found and reported the issue.
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/pos/unapply.scala | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/files/pos/unapply.scala b/test/files/pos/unapply.scala index 17577ef991..49f7181350 100644 --- a/test/files/pos/unapply.scala +++ b/test/files/pos/unapply.scala @@ -6,3 +6,22 @@ object Test { } } } + +// the following comes from ticket #230 +trait Foo { + def name : String + def unapply(x : String) : Option[Unit] = { + if(x == name) Some(()) else None + } +} +object Bar extends Foo { def name = "bar" } +object Baz extends Foo { def name = "baz" } + +object Test_ { + def matcher(s : String) = s match { + case Bar(x) => println("bar") + case Baz(x) => println("baz") +// ^ +// error: unreachable code + } + } |