From 59300ee6e3fc2c34482c7fb10ee4f7b298a6fbce Mon Sep 17 00:00:00 2001 From: Iulian Dragos Date: Mon, 2 Jul 2012 12:02:33 +0200 Subject: 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. --- test/files/run/patmat-finally.scala | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/files/run/patmat-finally.scala (limited to 'test/files/run') 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 +} -- cgit v1.2.3