From fa1dc5afea96d5917bc8a4883e3ee2d23db4744e Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Tue, 17 Jul 2012 18:55:35 +0200 Subject: SI-6089 better tail position analysis for matches we mistakenly went into apply nodes to look for matchEnd-labeldefs in tail positions -- only apply nodes that jump to labels in tailpos should be traversed (this arises for nested matches) --- test/files/run/t6089.check | 1 + test/files/run/t6089.scala | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 test/files/run/t6089.check create mode 100644 test/files/run/t6089.scala (limited to 'test') diff --git a/test/files/run/t6089.check b/test/files/run/t6089.check new file mode 100644 index 0000000000..a8d4424106 --- /dev/null +++ b/test/files/run/t6089.check @@ -0,0 +1 @@ +scala.MatchError: Foo(0) (of class Foo) diff --git a/test/files/run/t6089.scala b/test/files/run/t6089.scala new file mode 100644 index 0000000000..c72d7ba792 --- /dev/null +++ b/test/files/run/t6089.scala @@ -0,0 +1,13 @@ +case class Foo(x: Int) + +object Test { + def bippo(result: Boolean): Boolean = result + def bungus(m: Foo): Boolean = + bippo(m match { case Foo(2) => bungus(m) }) + + def main(args: Array[String]): Unit = try { + bungus(Foo(0)) + } catch { + case x: MatchError => println(x) + } +} \ No newline at end of file -- cgit v1.2.3