From 858a5d513779f4af6f12c0a530bdeceb7a7fd4d9 Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Mon, 2 Dec 2013 17:10:35 -0800 Subject: Modularize continuations plugin. The continuations plugin and library will still ship with 2.11 (albeit unsupported). They now reside at https://github.com/scala/scala-continuations. --- test/files/continuations-neg/function0.check | 6 ---- test/files/continuations-neg/function0.scala | 16 ----------- test/files/continuations-neg/function2.check | 6 ---- test/files/continuations-neg/function2.scala | 16 ----------- test/files/continuations-neg/function3.check | 6 ---- test/files/continuations-neg/function3.scala | 15 ---------- test/files/continuations-neg/infer2.check | 4 --- test/files/continuations-neg/infer2.scala | 19 ------------- test/files/continuations-neg/lazy.check | 4 --- test/files/continuations-neg/lazy.scala | 16 ----------- test/files/continuations-neg/t1929.check | 6 ---- test/files/continuations-neg/t1929.scala | 17 ----------- test/files/continuations-neg/t2285.check | 6 ---- test/files/continuations-neg/t2285.scala | 11 -------- test/files/continuations-neg/t2949.check | 6 ---- test/files/continuations-neg/t2949.scala | 15 ---------- test/files/continuations-neg/t3628.check | 4 --- test/files/continuations-neg/t3628.scala | 11 -------- test/files/continuations-neg/t3718.check | 4 --- test/files/continuations-neg/t3718.scala | 3 -- .../t5314-missing-result-type.check | 4 --- .../t5314-missing-result-type.scala | 13 --------- test/files/continuations-neg/t5314-npe.check | 4 --- test/files/continuations-neg/t5314-npe.scala | 3 -- .../continuations-neg/t5314-return-reset.check | 4 --- .../continuations-neg/t5314-return-reset.scala | 21 -------------- .../files/continuations-neg/t5314-type-error.check | 6 ---- .../files/continuations-neg/t5314-type-error.scala | 17 ----------- test/files/continuations-neg/t5445.check | 4 --- test/files/continuations-neg/t5445.scala | 5 ---- test/files/continuations-neg/trycatch2.check | 7 ----- test/files/continuations-neg/trycatch2.scala | 33 ---------------------- 32 files changed, 312 deletions(-) delete mode 100644 test/files/continuations-neg/function0.check delete mode 100644 test/files/continuations-neg/function0.scala delete mode 100644 test/files/continuations-neg/function2.check delete mode 100644 test/files/continuations-neg/function2.scala delete mode 100644 test/files/continuations-neg/function3.check delete mode 100644 test/files/continuations-neg/function3.scala delete mode 100644 test/files/continuations-neg/infer2.check delete mode 100644 test/files/continuations-neg/infer2.scala delete mode 100644 test/files/continuations-neg/lazy.check delete mode 100644 test/files/continuations-neg/lazy.scala delete mode 100644 test/files/continuations-neg/t1929.check delete mode 100644 test/files/continuations-neg/t1929.scala delete mode 100644 test/files/continuations-neg/t2285.check delete mode 100644 test/files/continuations-neg/t2285.scala delete mode 100644 test/files/continuations-neg/t2949.check delete mode 100644 test/files/continuations-neg/t2949.scala delete mode 100644 test/files/continuations-neg/t3628.check delete mode 100644 test/files/continuations-neg/t3628.scala delete mode 100644 test/files/continuations-neg/t3718.check delete mode 100644 test/files/continuations-neg/t3718.scala delete mode 100644 test/files/continuations-neg/t5314-missing-result-type.check delete mode 100644 test/files/continuations-neg/t5314-missing-result-type.scala delete mode 100644 test/files/continuations-neg/t5314-npe.check delete mode 100644 test/files/continuations-neg/t5314-npe.scala delete mode 100644 test/files/continuations-neg/t5314-return-reset.check delete mode 100644 test/files/continuations-neg/t5314-return-reset.scala delete mode 100644 test/files/continuations-neg/t5314-type-error.check delete mode 100644 test/files/continuations-neg/t5314-type-error.scala delete mode 100644 test/files/continuations-neg/t5445.check delete mode 100644 test/files/continuations-neg/t5445.scala delete mode 100644 test/files/continuations-neg/trycatch2.check delete mode 100644 test/files/continuations-neg/trycatch2.scala (limited to 'test/files/continuations-neg') diff --git a/test/files/continuations-neg/function0.check b/test/files/continuations-neg/function0.check deleted file mode 100644 index 0a66763a0f..0000000000 --- a/test/files/continuations-neg/function0.check +++ /dev/null @@ -1,6 +0,0 @@ -function0.scala:11: error: type mismatch; - found : () => Int @scala.util.continuations.cpsParam[Int,Int] - required: () => Int - val g: () => Int = f - ^ -one error found diff --git a/test/files/continuations-neg/function0.scala b/test/files/continuations-neg/function0.scala deleted file mode 100644 index 4112ee3835..0000000000 --- a/test/files/continuations-neg/function0.scala +++ /dev/null @@ -1,16 +0,0 @@ -// $Id$ - -import scala.util.continuations._ - - -object Test { - - def main(args: Array[String]): Any = { - - val f = () => shift { k: (Int=>Int) => k(7) } - val g: () => Int = f - - println(reset(g())) - } - -} \ No newline at end of file diff --git a/test/files/continuations-neg/function2.check b/test/files/continuations-neg/function2.check deleted file mode 100644 index 4b1a6227bc..0000000000 --- a/test/files/continuations-neg/function2.check +++ /dev/null @@ -1,6 +0,0 @@ -function2.scala:11: error: type mismatch; - found : () => Int - required: () => Int @scala.util.continuations.cpsParam[Int,Int] - val g: () => Int @cps[Int] = f - ^ -one error found diff --git a/test/files/continuations-neg/function2.scala b/test/files/continuations-neg/function2.scala deleted file mode 100644 index ae0fda509d..0000000000 --- a/test/files/continuations-neg/function2.scala +++ /dev/null @@ -1,16 +0,0 @@ -// $Id$ - -import scala.util.continuations._ - - -object Test { - - def main(args: Array[String]): Any = { - - val f = () => 7 - val g: () => Int @cps[Int] = f - - println(reset(g())) - } - -} \ No newline at end of file diff --git a/test/files/continuations-neg/function3.check b/test/files/continuations-neg/function3.check deleted file mode 100644 index 4705ad9ed9..0000000000 --- a/test/files/continuations-neg/function3.check +++ /dev/null @@ -1,6 +0,0 @@ -function3.scala:10: error: type mismatch; - found : Int @scala.util.continuations.cpsParam[Int,Int] - required: Int - val g: () => Int = () => shift { k: (Int=>Int) => k(7) } - ^ -one error found diff --git a/test/files/continuations-neg/function3.scala b/test/files/continuations-neg/function3.scala deleted file mode 100644 index 0c3f1667e5..0000000000 --- a/test/files/continuations-neg/function3.scala +++ /dev/null @@ -1,15 +0,0 @@ -// $Id$ - -import scala.util.continuations._ - - -object Test { - - def main(args: Array[String]): Any = { - - val g: () => Int = () => shift { k: (Int=>Int) => k(7) } - - println(reset(g())) - } - -} \ No newline at end of file diff --git a/test/files/continuations-neg/infer2.check b/test/files/continuations-neg/infer2.check deleted file mode 100644 index d92bc9c572..0000000000 --- a/test/files/continuations-neg/infer2.check +++ /dev/null @@ -1,4 +0,0 @@ -infer2.scala:14: error: illegal answer type modification: scala.util.continuations.cpsParam[String,Int] andThen scala.util.continuations.cpsParam[String,Int] - test { sym(); sym() } - ^ -one error found diff --git a/test/files/continuations-neg/infer2.scala b/test/files/continuations-neg/infer2.scala deleted file mode 100644 index a890ac1fc4..0000000000 --- a/test/files/continuations-neg/infer2.scala +++ /dev/null @@ -1,19 +0,0 @@ -// $Id$ - -import scala.util.continuations._ - - -object Test { - - def test(x: => Int @cpsParam[String,Int]) = 7 - - def sym() = shift { k: (Int => String) => 9 } - - - def main(args: Array[String]): Any = { - test { sym(); sym() } - } - -} - - diff --git a/test/files/continuations-neg/lazy.check b/test/files/continuations-neg/lazy.check deleted file mode 100644 index 3c460546be..0000000000 --- a/test/files/continuations-neg/lazy.check +++ /dev/null @@ -1,4 +0,0 @@ -lazy.scala:6: error: implementation restriction: cps annotations not allowed on lazy value definitions - lazy val x = shift((k:Unit=>Unit)=>k()) - ^ -one error found diff --git a/test/files/continuations-neg/lazy.scala b/test/files/continuations-neg/lazy.scala deleted file mode 100644 index 3c8169dd46..0000000000 --- a/test/files/continuations-neg/lazy.scala +++ /dev/null @@ -1,16 +0,0 @@ -import scala.util.continuations._ - -object Test { - - def foo() = { - lazy val x = shift((k:Unit=>Unit)=>k()) - println(x) - } - - def main(args: Array[String]) { - reset { - foo() - } - } - -} \ No newline at end of file diff --git a/test/files/continuations-neg/t1929.check b/test/files/continuations-neg/t1929.check deleted file mode 100644 index b04a5b977d..0000000000 --- a/test/files/continuations-neg/t1929.check +++ /dev/null @@ -1,6 +0,0 @@ -t1929.scala:8: error: type mismatch; - found : Int @scala.util.continuations.cpsParam[String,String] @scala.util.continuations.cpsSynth - required: Int @scala.util.continuations.cpsParam[Int,String] - reset { - ^ -one error found diff --git a/test/files/continuations-neg/t1929.scala b/test/files/continuations-neg/t1929.scala deleted file mode 100644 index 02eda9170d..0000000000 --- a/test/files/continuations-neg/t1929.scala +++ /dev/null @@ -1,17 +0,0 @@ -// $Id$ - -import scala.util.continuations._ - - -object Test { - def main(args : Array[String]) { - reset { - println("up") - val x = shift((k:Int=>String) => k(8) + k(2)) - println("down " + x) - val y = shift((k:Int=>String) => k(3)) - println("down2 " + y) - y + x - } - } -} \ No newline at end of file diff --git a/test/files/continuations-neg/t2285.check b/test/files/continuations-neg/t2285.check deleted file mode 100644 index d5dff6a4f2..0000000000 --- a/test/files/continuations-neg/t2285.check +++ /dev/null @@ -1,6 +0,0 @@ -t2285.scala:9: error: type mismatch; - found : Int @scala.util.continuations.cpsParam[String,String] @scala.util.continuations.cpsSynth - required: Int @scala.util.continuations.cpsParam[Int,String] - def foo() = reset { bar(); 7 } - ^ -one error found diff --git a/test/files/continuations-neg/t2285.scala b/test/files/continuations-neg/t2285.scala deleted file mode 100644 index f3c7f4c89c..0000000000 --- a/test/files/continuations-neg/t2285.scala +++ /dev/null @@ -1,11 +0,0 @@ -// $Id$ - -import scala.util.continuations._ - -object Test { - - def bar() = shift { k: (String => String) => k("1") } - - def foo() = reset { bar(); 7 } - -} diff --git a/test/files/continuations-neg/t2949.check b/test/files/continuations-neg/t2949.check deleted file mode 100644 index dd9768807c..0000000000 --- a/test/files/continuations-neg/t2949.check +++ /dev/null @@ -1,6 +0,0 @@ -t2949.scala:13: error: type mismatch; - found : Int - required: ? @scala.util.continuations.cpsParam[List[?],Any] - x * y - ^ -one error found diff --git a/test/files/continuations-neg/t2949.scala b/test/files/continuations-neg/t2949.scala deleted file mode 100644 index ce27c7c0e8..0000000000 --- a/test/files/continuations-neg/t2949.scala +++ /dev/null @@ -1,15 +0,0 @@ -// $Id$ - -import scala.util.continuations._ - -object Test { - - def reflect[A,B](xs : List[A]) = shift{ xs.flatMap[B, List[B]] } - def reify[A, B](x : A @cpsParam[List[A], B]) = reset{ List(x) } - - def main(args: Array[String]): Unit = println(reify { - val x = reflect[Int, Int](List(1,2,3)) - val y = reflect[Int, Int](List(2,4,8)) - x * y - }) -} diff --git a/test/files/continuations-neg/t3628.check b/test/files/continuations-neg/t3628.check deleted file mode 100644 index 6e390558ef..0000000000 --- a/test/files/continuations-neg/t3628.check +++ /dev/null @@ -1,4 +0,0 @@ -t3628.scala:4: error: not found: type Actor - val impl: Actor = actor { - ^ -one error found diff --git a/test/files/continuations-neg/t3628.scala b/test/files/continuations-neg/t3628.scala deleted file mode 100644 index c56e7752c4..0000000000 --- a/test/files/continuations-neg/t3628.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.actors.Actor._ - -object Test { - val impl: Actor = actor { - loop { - react { - case 1 => impl ! 2 - } - } - } -} diff --git a/test/files/continuations-neg/t3718.check b/test/files/continuations-neg/t3718.check deleted file mode 100644 index 659104c1c6..0000000000 --- a/test/files/continuations-neg/t3718.check +++ /dev/null @@ -1,4 +0,0 @@ -t3718.scala:2: error: cannot cps-transform malformed (possibly in shift/reset placement) expression - scala.util.continuations.reset((_: Any).##) - ^ -one error found diff --git a/test/files/continuations-neg/t3718.scala b/test/files/continuations-neg/t3718.scala deleted file mode 100644 index a0fcb9d869..0000000000 --- a/test/files/continuations-neg/t3718.scala +++ /dev/null @@ -1,3 +0,0 @@ -object Test { - scala.util.continuations.reset((_: Any).##) -} diff --git a/test/files/continuations-neg/t5314-missing-result-type.check b/test/files/continuations-neg/t5314-missing-result-type.check deleted file mode 100644 index 341e580cf3..0000000000 --- a/test/files/continuations-neg/t5314-missing-result-type.check +++ /dev/null @@ -1,4 +0,0 @@ -t5314-missing-result-type.scala:6: error: method bar has return statement; needs result type - def bar(x:Int) = return foo(x) - ^ -one error found diff --git a/test/files/continuations-neg/t5314-missing-result-type.scala b/test/files/continuations-neg/t5314-missing-result-type.scala deleted file mode 100644 index d7c5043a86..0000000000 --- a/test/files/continuations-neg/t5314-missing-result-type.scala +++ /dev/null @@ -1,13 +0,0 @@ -import scala.util.continuations._ - -object Test extends App { - def foo(x:Int): Int @cps[Int] = x - - def bar(x:Int) = return foo(x) - - reset { - val res = bar(8) - println(res) - res - } -} diff --git a/test/files/continuations-neg/t5314-npe.check b/test/files/continuations-neg/t5314-npe.check deleted file mode 100644 index b5f024aa89..0000000000 --- a/test/files/continuations-neg/t5314-npe.check +++ /dev/null @@ -1,4 +0,0 @@ -t5314-npe.scala:2: error: method bar has return statement; needs result type - def bar(x:Int) = { return x; x } // NPE - ^ -one error found diff --git a/test/files/continuations-neg/t5314-npe.scala b/test/files/continuations-neg/t5314-npe.scala deleted file mode 100644 index 2b5966e07c..0000000000 --- a/test/files/continuations-neg/t5314-npe.scala +++ /dev/null @@ -1,3 +0,0 @@ -object Test extends App { - def bar(x:Int) = { return x; x } // NPE -} diff --git a/test/files/continuations-neg/t5314-return-reset.check b/test/files/continuations-neg/t5314-return-reset.check deleted file mode 100644 index 4c817ae14d..0000000000 --- a/test/files/continuations-neg/t5314-return-reset.check +++ /dev/null @@ -1,4 +0,0 @@ -t5314-return-reset.scala:14: error: return expression not allowed, since method calls CPS method - if (rnd.nextInt(100) > 50) return 5 // not allowed, since method is calling `reset` - ^ -one error found diff --git a/test/files/continuations-neg/t5314-return-reset.scala b/test/files/continuations-neg/t5314-return-reset.scala deleted file mode 100644 index df9d58e4cb..0000000000 --- a/test/files/continuations-neg/t5314-return-reset.scala +++ /dev/null @@ -1,21 +0,0 @@ -import scala.util.continuations._ -import scala.util.Random - -object Test extends App { - val rnd = new Random - - def foo(x: Int): Int @cps[Int] = shift { k => k(x) } - - def bar(x: Int): Int @cps[Int] = return foo(x) - - def caller(): Int = { - val v: Int = reset { - val res: Int = bar(8) - if (rnd.nextInt(100) > 50) return 5 // not allowed, since method is calling `reset` - 42 - } - v - } - - caller() -} diff --git a/test/files/continuations-neg/t5314-type-error.check b/test/files/continuations-neg/t5314-type-error.check deleted file mode 100644 index e66c9d833f..0000000000 --- a/test/files/continuations-neg/t5314-type-error.check +++ /dev/null @@ -1,6 +0,0 @@ -t5314-type-error.scala:7: error: type mismatch; - found : Int @scala.util.continuations.cpsParam[Int,Int] - required: Int @scala.util.continuations.cpsParam[String,String] - def bar(x:Int): Int @cps[String] = return foo(x) - ^ -one error found diff --git a/test/files/continuations-neg/t5314-type-error.scala b/test/files/continuations-neg/t5314-type-error.scala deleted file mode 100644 index e36ce6c203..0000000000 --- a/test/files/continuations-neg/t5314-type-error.scala +++ /dev/null @@ -1,17 +0,0 @@ -import scala.util.continuations._ - -object Test extends App { - def foo(x:Int): Int @cps[Int] = shift { k => k(x) } - - // should be a type error - def bar(x:Int): Int @cps[String] = return foo(x) - - def caller(): Unit = { - val v: String = reset { - val res: Int = bar(8) - "hello" - } - } - - caller() -} diff --git a/test/files/continuations-neg/t5445.check b/test/files/continuations-neg/t5445.check deleted file mode 100644 index eb2943b6a6..0000000000 --- a/test/files/continuations-neg/t5445.check +++ /dev/null @@ -1,4 +0,0 @@ -t5445.scala:4: error: cps annotations not allowed on by-value parameters or value definitions - def foo(block: Unit @suspendable ): Unit @suspendable = {} - ^ -one error found diff --git a/test/files/continuations-neg/t5445.scala b/test/files/continuations-neg/t5445.scala deleted file mode 100644 index cb6f8f686d..0000000000 --- a/test/files/continuations-neg/t5445.scala +++ /dev/null @@ -1,5 +0,0 @@ -import scala.util.continuations._ - -object Test { - def foo(block: Unit @suspendable ): Unit @suspendable = {} -} diff --git a/test/files/continuations-neg/trycatch2.check b/test/files/continuations-neg/trycatch2.check deleted file mode 100644 index 5ff2838bad..0000000000 --- a/test/files/continuations-neg/trycatch2.check +++ /dev/null @@ -1,7 +0,0 @@ -trycatch2.scala:11: error: only simple cps types allowed in try/catch blocks (found: Int @scala.util.continuations.cpsParam[String,Int]) - def foo1 = try { - ^ -trycatch2.scala:19: error: only simple cps types allowed in try/catch blocks (found: Int @scala.util.continuations.cpsParam[String,Int]) - def foo2 = try { - ^ -two errors found diff --git a/test/files/continuations-neg/trycatch2.scala b/test/files/continuations-neg/trycatch2.scala deleted file mode 100644 index ee0a180ed6..0000000000 --- a/test/files/continuations-neg/trycatch2.scala +++ /dev/null @@ -1,33 +0,0 @@ -// $Id$ - -import scala.util.continuations._ - -object Test { - - def fatal[T]: T = throw new Exception - def cpsIntStringInt = shift { k:(Int=>String) => k(3); 7 } - def cpsIntIntString = shift { k:(Int=>Int) => k(3); "7" } - - def foo1 = try { - fatal[Int] - cpsIntStringInt - } catch { - case ex: Throwable => - cpsIntStringInt - } - - def foo2 = try { - fatal[Int] - cpsIntStringInt - } catch { - case ex: Throwable => - cpsIntStringInt - } - - - def main(args: Array[String]): Unit = { - println(reset { foo1; "3" }) - println(reset { foo2; "3" }) - } - -} -- cgit v1.2.3