diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2012-05-12 09:05:50 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2012-05-12 09:13:07 +0200 |
commit | f707141863799c801df6bdd3bbbc28a01c15bbbd (patch) | |
tree | 4673993ea44d6662a7255d09265838998e3ca0cd /test | |
parent | 3511e5960d510eafcb67c388ec0b5b60aafdd8f3 (diff) | |
download | scala-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')
-rw-r--r-- | test/files/run/t5407.check | 2 | ||||
-rw-r--r-- | test/files/run/t5407.scala | 17 |
2 files changed, 19 insertions, 0 deletions
diff --git a/test/files/run/t5407.check b/test/files/run/t5407.check new file mode 100644 index 0000000000..51993f072d --- /dev/null +++ b/test/files/run/t5407.check @@ -0,0 +1,2 @@ +2 +2 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 |