summaryrefslogtreecommitdiff
path: root/test/files/run/spec-nlreturn.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run/spec-nlreturn.scala')
-rw-r--r--test/files/run/spec-nlreturn.scala16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/files/run/spec-nlreturn.scala b/test/files/run/spec-nlreturn.scala
new file mode 100644
index 0000000000..ec5e7229d3
--- /dev/null
+++ b/test/files/run/spec-nlreturn.scala
@@ -0,0 +1,16 @@
+object Test {
+ def f(): Int = {
+ try {
+ val g = 1 to 10 map { i => return 16 ; i } sum;
+ g
+ }
+ catch { case x: runtime.NonLocalReturnControl[_] =>
+ println(x.getClass.getName)
+ x.value.asInstanceOf[Int]
+ }
+ }
+
+ def main(args: Array[String]): Unit = {
+ println(f())
+ }
+}