From 1a3976fc8276e6e3d7eeda12f645782ca93ea24b Mon Sep 17 00:00:00 2001 From: phaller Date: Tue, 26 Jun 2012 17:09:21 +0200 Subject: Revert pull request #720 (CPS: enable return expressions in CPS code if they are in tail position) Reverts commit 0ada0706746c9c603bf5bc8a0e6780e5783297cf. Reverts commit 51c92f02229098d0b402a65a72267f7a17984022. Reverts commit cdfbe8e39fbbec00c969cd74f117ae410b98b40b. Reverts commit 796024c7429a03e974a7d8e1dc5c80b84f82467d. --- .../continuations-neg/ts-1681-nontail-return.check | 4 -- .../continuations-neg/ts-1681-nontail-return.scala | 18 --------- test/files/continuations-run/ts-1681-2.check | 5 --- test/files/continuations-run/ts-1681-2.scala | 44 ---------------------- test/files/continuations-run/ts-1681-3.check | 4 -- test/files/continuations-run/ts-1681-3.scala | 27 ------------- test/files/continuations-run/ts-1681.check | 3 -- test/files/continuations-run/ts-1681.scala | 29 -------------- 8 files changed, 134 deletions(-) delete mode 100644 test/files/continuations-neg/ts-1681-nontail-return.check delete mode 100644 test/files/continuations-neg/ts-1681-nontail-return.scala delete mode 100644 test/files/continuations-run/ts-1681-2.check delete mode 100644 test/files/continuations-run/ts-1681-2.scala delete mode 100644 test/files/continuations-run/ts-1681-3.check delete mode 100644 test/files/continuations-run/ts-1681-3.scala delete mode 100644 test/files/continuations-run/ts-1681.check delete mode 100644 test/files/continuations-run/ts-1681.scala (limited to 'test/files') diff --git a/test/files/continuations-neg/ts-1681-nontail-return.check b/test/files/continuations-neg/ts-1681-nontail-return.check deleted file mode 100644 index 8fe15f154b..0000000000 --- a/test/files/continuations-neg/ts-1681-nontail-return.check +++ /dev/null @@ -1,4 +0,0 @@ -ts-1681-nontail-return.scala:10: error: return expressions in CPS code must be in tail position - return v - ^ -one error found diff --git a/test/files/continuations-neg/ts-1681-nontail-return.scala b/test/files/continuations-neg/ts-1681-nontail-return.scala deleted file mode 100644 index af86ad304f..0000000000 --- a/test/files/continuations-neg/ts-1681-nontail-return.scala +++ /dev/null @@ -1,18 +0,0 @@ -import scala.util.continuations._ - -class ReturnRepro { - def s1: Int @cpsParam[Any, Unit] = shift { k => k(5) } - def caller = reset { println(p(3)) } - - def p(i: Int): Int @cpsParam[Unit, Any] = { - val v= s1 + 3 - if (v == 8) - return v - v + 1 - } -} - -object Test extends App { - val repro = new ReturnRepro - repro.caller -} diff --git a/test/files/continuations-run/ts-1681-2.check b/test/files/continuations-run/ts-1681-2.check deleted file mode 100644 index 35b3c93780..0000000000 --- a/test/files/continuations-run/ts-1681-2.check +++ /dev/null @@ -1,5 +0,0 @@ -8 -hi -8 -from try -8 diff --git a/test/files/continuations-run/ts-1681-2.scala b/test/files/continuations-run/ts-1681-2.scala deleted file mode 100644 index 8a896dec2c..0000000000 --- a/test/files/continuations-run/ts-1681-2.scala +++ /dev/null @@ -1,44 +0,0 @@ -import scala.util.continuations._ - -class ReturnRepro { - def s1: Int @cps[Any] = shift { k => k(5) } - def caller = reset { println(p(3)) } - def caller2 = reset { println(p2(3)) } - def caller3 = reset { println(p3(3)) } - - def p(i: Int): Int @cps[Any] = { - val v= s1 + 3 - return v - } - - def p2(i: Int): Int @cps[Any] = { - val v = s1 + 3 - if (v > 0) { - println("hi") - return v - } else { - println("hi") - return 8 - } - } - - def p3(i: Int): Int @cps[Any] = { - val v = s1 + 3 - try { - println("from try") - return v - } catch { - case e: Exception => - println("from catch") - return 7 - } - } - -} - -object Test extends App { - val repro = new ReturnRepro - repro.caller - repro.caller2 - repro.caller3 -} diff --git a/test/files/continuations-run/ts-1681-3.check b/test/files/continuations-run/ts-1681-3.check deleted file mode 100644 index 71489f097c..0000000000 --- a/test/files/continuations-run/ts-1681-3.check +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index 62c547f5a2..0000000000 --- a/test/files/continuations-run/ts-1681-3.scala +++ /dev/null @@ -1,27 +0,0 @@ -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 -} diff --git a/test/files/continuations-run/ts-1681.check b/test/files/continuations-run/ts-1681.check deleted file mode 100644 index 85176d8e66..0000000000 --- a/test/files/continuations-run/ts-1681.check +++ /dev/null @@ -1,3 +0,0 @@ -8 -hi -8 diff --git a/test/files/continuations-run/ts-1681.scala b/test/files/continuations-run/ts-1681.scala deleted file mode 100644 index efb1abae15..0000000000 --- a/test/files/continuations-run/ts-1681.scala +++ /dev/null @@ -1,29 +0,0 @@ -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 -} -- cgit v1.2.3