summaryrefslogtreecommitdiff
path: root/test/files/run/t5407.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2012-05-12 09:05:50 +0200
committerJason Zaugg <jzaugg@gmail.com>2012-05-12 09:13:07 +0200
commitf707141863799c801df6bdd3bbbc28a01c15bbbd (patch)
tree4673993ea44d6662a7255d09265838998e3ca0cd /test/files/run/t5407.scala
parent3511e5960d510eafcb67c388ec0b5b60aafdd8f3 (diff)
downloadscala-f707141863799c801df6bdd3bbbc28a01c15bbbd.tar.gz
scala-f707141863799c801df6bdd3bbbc28a01c15bbbd.tar.bz2
scala-f707141863799c801df6bdd3bbbc28a01c15bbbd.zip
Test case closes SI-5407
It still breaks as described in the ticket under -Xoldpatmat.
Diffstat (limited to 'test/files/run/t5407.scala')
-rw-r--r--test/files/run/t5407.scala17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/files/run/t5407.scala b/test/files/run/t5407.scala
new file mode 100644
index 0000000000..35a8ec6a45
--- /dev/null
+++ b/test/files/run/t5407.scala
@@ -0,0 +1,17 @@
+case class Foo(private val x: Int, y: Option[Int], z: Boolean)
+
+object Test extends App {
+ def foo(x: Foo) = x match {
+ case Foo(x, Some(y), z) => y
+ case Foo(x, y, z) => 0
+ }
+ val x = Foo(1, Some(2), false)
+ println(foo(x))
+
+
+ def bar(x: Foo) = x match {
+ case Foo(x, Some(y), z) => y
+ case Foo(x, None, z) => 0
+ }
+ println(bar(x))
+} \ No newline at end of file