diff options
author | phaller <hallerp@gmail.com> | 2012-08-09 14:50:30 +0200 |
---|---|---|
committer | phaller <hallerp@gmail.com> | 2012-08-09 14:50:30 +0200 |
commit | 8d020fab9758ced93eb18fa51c906b95ec104aed (patch) | |
tree | 2a5c394a11fb984a860c246a37a7b62cd824797b /test/files/continuations-run/t5314.scala | |
parent | b9c3a3b083833d2166b3d2ca2d1ccbca36b83c71 (diff) | |
download | scala-8d020fab9758ced93eb18fa51c906b95ec104aed.tar.gz scala-8d020fab9758ced93eb18fa51c906b95ec104aed.tar.bz2 scala-8d020fab9758ced93eb18fa51c906b95ec104aed.zip |
Add missing cases in tail return transform
Disabled warnings that no longer apply because of tail returns.
Add several test cases.
Diffstat (limited to 'test/files/continuations-run/t5314.scala')
-rw-r--r-- | test/files/continuations-run/t5314.scala | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/files/continuations-run/t5314.scala b/test/files/continuations-run/t5314.scala index 0bdea19824..d611016ce4 100644 --- a/test/files/continuations-run/t5314.scala +++ b/test/files/continuations-run/t5314.scala @@ -29,6 +29,17 @@ object Test extends App { def nocps(x: Int): Int = { return x; x } + def foo2(x:Int): Int @cps[Int] = 7 + def bar2(x:Int): Int @cps[Int] = { foo2(x); return 7 } + def bar3(x:Int): Int @cps[Int] = { foo2(x); if (x == 7) return 7 else return foo2(x) } + def bar4(x:Int): Int @cps[Int] = { foo2(x); if (x == 7) return 7 else foo2(x) } + def bar5(x:Int): Int @cps[Int] = { foo2(x); if (x == 7) return 7 else 8 } + println(reset { bar2(10) }) + println(reset { bar3(10) }) + println(reset { bar4(10) }) + println(reset { bar5(10) }) + + /* original test case */ val repro = new ReturnRepro repro.caller repro.caller2 |