summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorphaller <philipp.haller@typesafe.com>2012-06-15 16:53:19 +0200
committerphaller <philipp.haller@typesafe.com>2012-06-15 16:53:19 +0200
commit51c92f02229098d0b402a65a72267f7a17984022 (patch)
tree8a9c99d097640190421c3a35ac1b0b6ddf18151f /test
parentcdfbe8e39fbbec00c969cd74f117ae410b98b40b (diff)
downloadscala-51c92f02229098d0b402a65a72267f7a17984022.tar.gz
scala-51c92f02229098d0b402a65a72267f7a17984022.tar.bz2
scala-51c92f02229098d0b402a65a72267f7a17984022.zip
Replace context stack of AnnotationChecker with new mode for typing returns
Diffstat (limited to 'test')
-rw-r--r--test/files/continuations-run/ts-1681-3.check4
-rw-r--r--test/files/continuations-run/ts-1681-3.scala27
2 files changed, 31 insertions, 0 deletions
diff --git a/test/files/continuations-run/ts-1681-3.check b/test/files/continuations-run/ts-1681-3.check
new file mode 100644
index 0000000000..71489f097c
--- /dev/null
+++ b/test/files/continuations-run/ts-1681-3.check
@@ -0,0 +1,4 @@
+enter return expr
+8
+hi
+8
diff --git a/test/files/continuations-run/ts-1681-3.scala b/test/files/continuations-run/ts-1681-3.scala
new file mode 100644
index 0000000000..62c547f5a2
--- /dev/null
+++ b/test/files/continuations-run/ts-1681-3.scala
@@ -0,0 +1,27 @@
+import scala.util.continuations._
+
+class ReturnRepro {
+ def s1: Int @cpsParam[Any, Unit] = shift { k => k(5) }
+ def caller = reset { println(p(3)) }
+ def caller2 = reset { println(p2(3)) }
+
+ def p(i: Int): Int @cpsParam[Unit, Any] = {
+ val v= s1 + 3
+ return { println("enter return expr"); v }
+ }
+
+ def p2(i: Int): Int @cpsParam[Unit, Any] = {
+ val v = s1 + 3
+ if (v > 0) {
+ return { println("hi"); v }
+ } else {
+ return { println("hi"); 8 }
+ }
+ }
+}
+
+object Test extends App {
+ val repro = new ReturnRepro
+ repro.caller
+ repro.caller2
+}