diff options
Diffstat (limited to 'test/files/continuations-run/ts-1681.scala')
-rw-r--r-- | test/files/continuations-run/ts-1681.scala | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/files/continuations-run/ts-1681.scala b/test/files/continuations-run/ts-1681.scala new file mode 100644 index 0000000000..efb1abae15 --- /dev/null +++ b/test/files/continuations-run/ts-1681.scala @@ -0,0 +1,29 @@ +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 v + } + + def p2(i: Int): Int @cpsParam[Unit, Any] = { + val v = s1 + 3 + if (v > 0) { + println("hi") + return v + } else { + println("hi") + return 8 + } + } +} + +object Test extends App { + val repro = new ReturnRepro + repro.caller + repro.caller2 +} |