summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2012-07-02 12:02:33 +0200
committerIulian Dragos <jaguarul@gmail.com>2012-07-02 12:02:33 +0200
commit59300ee6e3fc2c34482c7fb10ee4f7b298a6fbce (patch)
treed0d963940c5bb8c185fe9aa6f9a03f2b31a09a11 /test
parentbad1e8e6d7f513f37353c9f7f23dbde5f59cb038 (diff)
downloadscala-59300ee6e3fc2c34482c7fb10ee4f7b298a6fbce.tar.gz
scala-59300ee6e3fc2c34482c7fb10ee4f7b298a6fbce.tar.bz2
scala-59300ee6e3fc2c34482c7fb10ee4f7b298a6fbce.zip
Fix SI-5929 - Verify error with finally and pattern match
Don't enter all labels in a method when emitting a forward jump, since some labels will be duplicated (if defined inside finally blocks). For each forward jump, enter only the label that is needed for that jump.
Diffstat (limited to 'test')
-rw-r--r--test/files/run/patmat-finally.scala25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/files/run/patmat-finally.scala b/test/files/run/patmat-finally.scala
new file mode 100644
index 0000000000..6f769b30a0
--- /dev/null
+++ b/test/files/run/patmat-finally.scala
@@ -0,0 +1,25 @@
+/** Test pattern matching and finally, see SI-5929. */
+object Test extends App {
+ def bar(s1: Object, s2: Object) {
+ s1 match {
+ case _ =>
+ }
+
+ try {
+ ()
+ } finally {
+ s2 match {
+ case _ =>
+ }
+ }
+ }
+
+ def x = {
+ null match { case _ => }
+
+ try { 1 } finally { while(false) { } }
+ }
+
+ bar(null, null)
+ x
+}