diff options
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/run/spec-nlreturn.check | 2 | ||||
-rw-r--r-- | test/files/run/spec-nlreturn.scala | 16 |
2 files changed, 18 insertions, 0 deletions
diff --git a/test/files/run/spec-nlreturn.check b/test/files/run/spec-nlreturn.check new file mode 100644 index 0000000000..26cff07360 --- /dev/null +++ b/test/files/run/spec-nlreturn.check @@ -0,0 +1,2 @@ +scala.runtime.NonLocalReturnControl$mcI$sp +16 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()) + } +} |