summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-02-27 21:58:26 -0800
committerPaul Phillips <paulp@improving.org>2012-02-27 22:12:52 -0800
commit0bcc8f8f92bbee772924813d00512f3765d4beee (patch)
tree98e9d0320fb8be7ee91ffe3312631b0c867106e1 /test/files
parent07ffa8d66dedcf2bf2ac26d5e31f09922f5479ce (diff)
downloadscala-0bcc8f8f92bbee772924813d00512f3765d4beee.tar.gz
scala-0bcc8f8f92bbee772924813d00512f3765d4beee.tar.bz2
scala-0bcc8f8f92bbee772924813d00512f3765d4beee.zip
Specialized NonLocalReturnControl.
From the extempore archive of already implemented things.
Diffstat (limited to 'test/files')
-rw-r--r--test/files/run/spec-nlreturn.check2
-rw-r--r--test/files/run/spec-nlreturn.scala16
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())
+ }
+}