From f707141863799c801df6bdd3bbbc28a01c15bbbd Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Sat, 12 May 2012 09:05:50 +0200 Subject: Test case closes SI-5407 It still breaks as described in the ticket under -Xoldpatmat. --- test/files/run/t5407.check | 2 ++ test/files/run/t5407.scala | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 test/files/run/t5407.check create mode 100644 test/files/run/t5407.scala (limited to 'test/files/run') 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 -- cgit v1.2.3