diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-07-17 18:55:35 +0200 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-07-18 10:32:34 +0200 |
commit | fa1dc5afea96d5917bc8a4883e3ee2d23db4744e (patch) | |
tree | 0cb4e3198dc529d5288f8ed5a93497fffebc81e2 /test/files/run | |
parent | 0cfd858a38ddf0ac83d9bbefe85110f88dc707c0 (diff) | |
download | scala-fa1dc5afea96d5917bc8a4883e3ee2d23db4744e.tar.gz scala-fa1dc5afea96d5917bc8a4883e3ee2d23db4744e.tar.bz2 scala-fa1dc5afea96d5917bc8a4883e3ee2d23db4744e.zip |
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)
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/t6089.check | 1 | ||||
-rw-r--r-- | test/files/run/t6089.scala | 13 |
2 files changed, 14 insertions, 0 deletions
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 |