diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-12-02 17:10:35 -0800 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-12-13 17:36:16 -0800 |
commit | 858a5d513779f4af6f12c0a530bdeceb7a7fd4d9 (patch) | |
tree | becda6df1363a92c1fcdf39643433ba101de4c10 /test/files/continuations-run | |
parent | 7e74aa6b134bcaf158bd51aa7a63a4aaa8fee62e (diff) | |
download | scala-858a5d513779f4af6f12c0a530bdeceb7a7fd4d9.tar.gz scala-858a5d513779f4af6f12c0a530bdeceb7a7fd4d9.tar.bz2 scala-858a5d513779f4af6f12c0a530bdeceb7a7fd4d9.zip |
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.
Diffstat (limited to 'test/files/continuations-run')
78 files changed, 0 insertions, 1331 deletions
diff --git a/test/files/continuations-run/basics.check b/test/files/continuations-run/basics.check deleted file mode 100755 index 54c059fdcb..0000000000 --- a/test/files/continuations-run/basics.check +++ /dev/null @@ -1,2 +0,0 @@ -28 -28
\ No newline at end of file diff --git a/test/files/continuations-run/basics.scala b/test/files/continuations-run/basics.scala deleted file mode 100755 index 07b3de5194..0000000000 --- a/test/files/continuations-run/basics.scala +++ /dev/null @@ -1,23 +0,0 @@ -// $Id$ - -import scala.util.continuations._ - - -object Test { - - def m0() = { - shift((k:Int => Int) => k(k(7))) * 2 - } - - def m1() = { - 2 * shift((k:Int => Int) => k(k(7))) - } - - def main(args: Array[String]) { - - println(reset(m0())) - println(reset(m1())) - - } - -} diff --git a/test/files/continuations-run/function1.check b/test/files/continuations-run/function1.check deleted file mode 100644 index 7f8f011eb7..0000000000 --- a/test/files/continuations-run/function1.check +++ /dev/null @@ -1 +0,0 @@ -7 diff --git a/test/files/continuations-run/function1.scala b/test/files/continuations-run/function1.scala deleted file mode 100644 index 82dfe46c08..0000000000 --- a/test/files/continuations-run/function1.scala +++ /dev/null @@ -1,16 +0,0 @@ -// $Id$ - -import scala.util.continuations._ - - -object Test { - - def main(args: Array[String]): Unit = { - - val f = () => shift { k: (Int=>Int) => k(7) } - val g: () => Int @cps[Int] = f - - println(reset(g())) - } - -} diff --git a/test/files/continuations-run/function4.check b/test/files/continuations-run/function4.check deleted file mode 100644 index c7930257df..0000000000 --- a/test/files/continuations-run/function4.check +++ /dev/null @@ -1 +0,0 @@ -7
\ No newline at end of file diff --git a/test/files/continuations-run/function4.scala b/test/files/continuations-run/function4.scala deleted file mode 100644 index ccb432fe93..0000000000 --- a/test/files/continuations-run/function4.scala +++ /dev/null @@ -1,15 +0,0 @@ -// $Id$ - -import scala.util.continuations._ - - -object Test { - - def main(args: Array[String]): Unit = { - - val g: () => Int @cps[Int] = () => shift { k: (Int=>Int) => k(7) } - - println(reset(g())) - } - -} diff --git a/test/files/continuations-run/function5.check b/test/files/continuations-run/function5.check deleted file mode 100644 index c7930257df..0000000000 --- a/test/files/continuations-run/function5.check +++ /dev/null @@ -1 +0,0 @@ -7
\ No newline at end of file diff --git a/test/files/continuations-run/function5.scala b/test/files/continuations-run/function5.scala deleted file mode 100644 index a83eb80d08..0000000000 --- a/test/files/continuations-run/function5.scala +++ /dev/null @@ -1,15 +0,0 @@ -// $Id$ - -import scala.util.continuations._ - - -object Test { - - def main(args: Array[String]): Unit = { - - val g: () => Int @cps[Int] = () => 7 - - println(reset(g())) - } - -} diff --git a/test/files/continuations-run/function6.check b/test/files/continuations-run/function6.check deleted file mode 100644 index c7930257df..0000000000 --- a/test/files/continuations-run/function6.check +++ /dev/null @@ -1 +0,0 @@ -7
\ No newline at end of file diff --git a/test/files/continuations-run/function6.scala b/test/files/continuations-run/function6.scala deleted file mode 100644 index 13ef88bd9f..0000000000 --- a/test/files/continuations-run/function6.scala +++ /dev/null @@ -1,16 +0,0 @@ -// $Id$ - -import scala.util.continuations._ - - -object Test { - - def main(args: Array[String]): Unit = { - - val g: PartialFunction[Int, Int @cps[Int]] = { case x => 7 } - - println(reset(g(2))) - - } - -} diff --git a/test/files/continuations-run/ifelse0.check b/test/files/continuations-run/ifelse0.check deleted file mode 100644 index f8bc79860d..0000000000 --- a/test/files/continuations-run/ifelse0.check +++ /dev/null @@ -1,2 +0,0 @@ -10 -9
\ No newline at end of file diff --git a/test/files/continuations-run/ifelse0.scala b/test/files/continuations-run/ifelse0.scala deleted file mode 100644 index cbff72c77c..0000000000 --- a/test/files/continuations-run/ifelse0.scala +++ /dev/null @@ -1,18 +0,0 @@ -// $Id$ - -import scala.util.continuations._ - - -object Test { - - def test(x:Int) = if (x <= 7) - shift { k: (Int=>Int) => k(k(k(x))) } - else - shift { k: (Int=>Int) => k(x) } - - def main(args: Array[String]): Unit = { - println(reset(1 + test(7))) - println(reset(1 + test(8))) - } - -} diff --git a/test/files/continuations-run/ifelse1.check b/test/files/continuations-run/ifelse1.check deleted file mode 100644 index 86a3fbc0c1..0000000000 --- a/test/files/continuations-run/ifelse1.check +++ /dev/null @@ -1,4 +0,0 @@ -10 -9 -8 -11
\ No newline at end of file diff --git a/test/files/continuations-run/ifelse1.scala b/test/files/continuations-run/ifelse1.scala deleted file mode 100644 index f8e3cf2ca3..0000000000 --- a/test/files/continuations-run/ifelse1.scala +++ /dev/null @@ -1,25 +0,0 @@ -// $Id$ - -import scala.util.continuations._ - - -object Test { - - def test1(x:Int) = if (x <= 7) - shift { k: (Int=>Int) => k(k(k(x))) } - else - x - - def test2(x:Int) = if (x <= 7) - x - else - shift { k: (Int=>Int) => k(k(k(x))) } - - def main(args: Array[String]): Unit = { - println(reset(1 + test1(7))) - println(reset(1 + test1(8))) - println(reset(1 + test2(7))) - println(reset(1 + test2(8))) - } - -} diff --git a/test/files/continuations-run/ifelse2.check b/test/files/continuations-run/ifelse2.check deleted file mode 100644 index f97a95b08d..0000000000 --- a/test/files/continuations-run/ifelse2.check +++ /dev/null @@ -1,4 +0,0 @@ -abort -() -alive -() diff --git a/test/files/continuations-run/ifelse2.scala b/test/files/continuations-run/ifelse2.scala deleted file mode 100644 index f5ec864a06..0000000000 --- a/test/files/continuations-run/ifelse2.scala +++ /dev/null @@ -1,16 +0,0 @@ -// $Id$ - -import scala.util.continuations._ - - -object Test { - - def test(x:Int) = if (x <= 7) - shift { k: (Unit=>Unit) => println("abort") } - - def main(args: Array[String]): Unit = { - println(reset{ test(7); println("alive") }) - println(reset{ test(8); println("alive") }) - } - -} diff --git a/test/files/continuations-run/ifelse3.check b/test/files/continuations-run/ifelse3.check deleted file mode 100644 index 95b562c8e6..0000000000 --- a/test/files/continuations-run/ifelse3.check +++ /dev/null @@ -1,2 +0,0 @@ -6 -9 diff --git a/test/files/continuations-run/ifelse3.scala b/test/files/continuations-run/ifelse3.scala deleted file mode 100644 index 2c5b5765db..0000000000 --- a/test/files/continuations-run/ifelse3.scala +++ /dev/null @@ -1,21 +0,0 @@ -// $Id$ - -import scala.util.continuations._ - - -object Test { - - def util(x: Boolean) = shift { k: (Boolean=>Int) => k(x) } - - def test(x:Int) = if (util(x <= 7)) - x - 1 - else - x + 1 - - - def main(args: Array[String]): Unit = { - println(reset(test(7))) - println(reset(test(8))) - } - -} diff --git a/test/files/continuations-run/ifelse4.check b/test/files/continuations-run/ifelse4.check deleted file mode 100644 index 2545dd49a0..0000000000 --- a/test/files/continuations-run/ifelse4.check +++ /dev/null @@ -1,4 +0,0 @@ -10 -10 -10 -10 diff --git a/test/files/continuations-run/ifelse4.scala b/test/files/continuations-run/ifelse4.scala deleted file mode 100644 index 46ec15365e..0000000000 --- a/test/files/continuations-run/ifelse4.scala +++ /dev/null @@ -1,31 +0,0 @@ -import scala.util.continuations._ - -object Test { - def sh(x1:Int) = shift( (k: Int => Int) => k(k(k(x1)))) - - def testA(x1: Int): Int @cps[Int] = { - sh(x1) - if (x1==42) x1 else sh(x1) - } - - def testB(x1: Int): Int @cps[Int] = { - if (sh(x1)==43) x1 else x1 - } - - def testC(x1: Int): Int @cps[Int] = { - sh(x1) - if (sh(x1)==44) x1 else x1 - } - - def testD(x1: Int): Int @cps[Int] = { - sh(x1) - if (sh(x1)==45) x1 else sh(x1) - } - - def main(args: Array[String]): Unit = { - println(reset(1 + testA(7))) - println(reset(1 + testB(9))) - println(reset(1 + testC(9))) - println(reset(1 + testD(7))) - } -} diff --git a/test/files/continuations-run/implicit-infer-annotations.check b/test/files/continuations-run/implicit-infer-annotations.check deleted file mode 100644 index e8206c4319..0000000000 --- a/test/files/continuations-run/implicit-infer-annotations.check +++ /dev/null @@ -1,5 +0,0 @@ -Range(5, 6, 7, 8, 9, 10) -Range(5, 6, 7, 8, 9, 10) -15 -List(10, 1, 2, 3) -Range(5, 6, 7, 8, 9, 10) diff --git a/test/files/continuations-run/implicit-infer-annotations.scala b/test/files/continuations-run/implicit-infer-annotations.scala deleted file mode 100644 index 3f0e959f60..0000000000 --- a/test/files/continuations-run/implicit-infer-annotations.scala +++ /dev/null @@ -1,59 +0,0 @@ -import annotation._ - -object A { - class foo[-B,+C] extends StaticAnnotation with TypeConstraint - - def shift[A, B, C](fun: (A => B) => C): A @foo[B, C] = ??? - def reset[A, C](ctx: => (A @foo[A, C])): C = ??? - - def m1 = reset { shift { f: (Int => Range) => f(5) }.to(10) } -} - -object B { - import scala.util.continuations._ - - def m1 = reset { shift { f: (Int => Range) => f(5) }.to(10) } - def m2 = reset { val a = shift { f: (Int => Range) => f(5) } ; a.to(10) } - - val x1 = reset{ - shift{ cont: (Int => Range) => - cont(5) - }.to(10) - } - - val x2 = reset{ - val a = shift{ cont: (Int => Range) => - cont(5) - } - a.to(10) - } // x is now Range(5, 6, 7, 8, 9, 10) - - val x3 = reset{ - shift{ cont: (Int => Int) => - cont(5) - } + 10 - } // x is now 15 - - val x4 = reset{ - 10 :: shift{ cont: (List[Int] => List[Int]) => - cont(List(1, 2, 3)) - } - } // x is List(10, 1, 2, 3) - - val x5 = reset{ - new scala.runtime.RichInt(shift{ cont: (Int => Range) => - cont(5) - }) to 10 - } -} - -object Test { - def main(args: Array[String]): Unit = { - import B._ - println(x1) - println(x2) - println(x3) - println(x4) - println(x5) - } -} diff --git a/test/files/continuations-run/infer1.scala b/test/files/continuations-run/infer1.scala deleted file mode 100644 index 76f746da57..0000000000 --- a/test/files/continuations-run/infer1.scala +++ /dev/null @@ -1,33 +0,0 @@ -// $Id$ - -import scala.util.continuations._ - - -object Test { - - def test(x: => Int @cpsParam[String,Int]) = 7 - - def test2() = { - val x = shift { k: (Int => String) => 9 } - x - } - - def test3(x: => Int @cpsParam[Int,Int]) = 7 - - - def util() = shift { k: (String => String) => "7" } - - def main(args: Array[String]): Unit = { - test { shift { k: (Int => String) => 9 } } - test { shift { k: (Int => String) => 9 }; 2 } -// test { shift { k: (Int => String) => 9 }; util() } <-- doesn't work - test { shift { k: (Int => String) => 9 }; util(); 2 } - - - test { shift { k: (Int => String) => 9 }; { test3(0); 2 } } - - test3 { { test3(0); 2 } } - - } - -} diff --git a/test/files/continuations-run/match0.check b/test/files/continuations-run/match0.check deleted file mode 100644 index f8bc79860d..0000000000 --- a/test/files/continuations-run/match0.check +++ /dev/null @@ -1,2 +0,0 @@ -10 -9
\ No newline at end of file diff --git a/test/files/continuations-run/match0.scala b/test/files/continuations-run/match0.scala deleted file mode 100644 index 8769ed9fcb..0000000000 --- a/test/files/continuations-run/match0.scala +++ /dev/null @@ -1,18 +0,0 @@ -// $Id$ - -import scala.util.continuations._ - - -object Test { - - def test(x:Int) = x match { - case 7 => shift { k: (Int=>Int) => k(k(k(x))) } - case 8 => shift { k: (Int=>Int) => k(x) } - } - - def main(args: Array[String]): Unit = { - println(reset(1 + test(7))) - println(reset(1 + test(8))) - } - -} diff --git a/test/files/continuations-run/match1.check b/test/files/continuations-run/match1.check deleted file mode 100644 index 73053d3f4f..0000000000 --- a/test/files/continuations-run/match1.check +++ /dev/null @@ -1,2 +0,0 @@ -10 -9 diff --git a/test/files/continuations-run/match1.scala b/test/files/continuations-run/match1.scala deleted file mode 100644 index b89fb706b0..0000000000 --- a/test/files/continuations-run/match1.scala +++ /dev/null @@ -1,18 +0,0 @@ -// $Id$ - -import scala.util.continuations._ - - -object Test { - - def test(x:Int) = x match { - case 7 => shift { k: (Int=>Int) => k(k(k(x))) } - case _ => x - } - - def main(args: Array[String]): Unit = { - println(reset(1 + test(7))) - println(reset(1 + test(8))) - } - -} diff --git a/test/files/continuations-run/match2.check b/test/files/continuations-run/match2.check deleted file mode 100644 index cbf91349cc..0000000000 --- a/test/files/continuations-run/match2.check +++ /dev/null @@ -1,2 +0,0 @@ -B -B diff --git a/test/files/continuations-run/match2.scala b/test/files/continuations-run/match2.scala deleted file mode 100644 index 002d9b52dd..0000000000 --- a/test/files/continuations-run/match2.scala +++ /dev/null @@ -1,26 +0,0 @@ -// $Id$ - -import scala.util.continuations._ - - -object Test { - - def test1() = { - val (a, b) = shift { k: (((String,String)) => String) => k("A","B") } - b - } - - case class Elem[T,U](a: T, b: U) - - def test2() = { - val Elem(a,b) = shift { k: (Elem[String,String] => String) => k(Elem("A","B")) } - b - } - - - def main(args: Array[String]): Unit = { - println(reset(test1())) - println(reset(test2())) - } - -}
\ No newline at end of file diff --git a/test/files/continuations-run/patvirt.check b/test/files/continuations-run/patvirt.check deleted file mode 100644 index b5fa014ad3..0000000000 --- a/test/files/continuations-run/patvirt.check +++ /dev/null @@ -1,2 +0,0 @@ -10 -11 diff --git a/test/files/continuations-run/patvirt.scala b/test/files/continuations-run/patvirt.scala deleted file mode 100644 index cfbdda538d..0000000000 --- a/test/files/continuations-run/patvirt.scala +++ /dev/null @@ -1,32 +0,0 @@ -import scala.util.continuations._ - -object Test { - def sh(x1:Int) = shift( (k: Int => Int) => k(k(k(x1)))) - - def test(x1: Int) = { - val o7 = { - val o6 = { - val o3 = - if (7 == x1) Some(x1) - else None - - if (o3.isEmpty) None - else Some(sh(x1)) - } - if (o6.isEmpty) { - val o5 = - if (8 == x1) Some(x1) - else None - - if (o5.isEmpty) None - else Some(sh(x1)) - } else o6 - } - o7.get - } - - def main(args: Array[String]): Unit = { - println(reset(1 + test(7))) - println(reset(1 + test(8))) - } -} diff --git a/test/files/continuations-run/shift-pct.check b/test/files/continuations-run/shift-pct.check deleted file mode 100644 index fb190e770a..0000000000 --- a/test/files/continuations-run/shift-pct.check +++ /dev/null @@ -1,25 +0,0 @@ -d = 1, d2 = 1.0, pct = 1.000 -d = 2, d2 = 4.0, pct = 0.500 -d = 3, d2 = 9.0, pct = 0.333 -d = 4, d2 = 16.0, pct = 0.250 -d = 5, d2 = 25.0, pct = 0.200 -d = 6, d2 = 36.0, pct = 0.167 -d = 7, d2 = 49.0, pct = 0.143 -d = 8, d2 = 64.0, pct = 0.125 -d = 9, d2 = 81.0, pct = 0.111 -d = 10, d2 = 100.0, pct = 0.100 -d = 11, d2 = 121.0, pct = 0.091 -d = 12, d2 = 144.0, pct = 0.083 -d = 13, d2 = 169.0, pct = 0.077 -d = 14, d2 = 196.0, pct = 0.071 -d = 15, d2 = 225.0, pct = 0.067 -d = 16, d2 = 256.0, pct = 0.063 -d = 17, d2 = 289.0, pct = 0.059 -d = 18, d2 = 324.0, pct = 0.056 -d = 19, d2 = 361.0, pct = 0.053 -d = 20, d2 = 400.0, pct = 0.050 -d = 21, d2 = 441.0, pct = 0.048 -d = 22, d2 = 484.0, pct = 0.045 -d = 23, d2 = 529.0, pct = 0.043 -d = 24, d2 = 576.0, pct = 0.042 -d = 25, d2 = 625.0, pct = 0.040 diff --git a/test/files/continuations-run/shift-pct.scala b/test/files/continuations-run/shift-pct.scala deleted file mode 100644 index 7ef9922168..0000000000 --- a/test/files/continuations-run/shift-pct.scala +++ /dev/null @@ -1,30 +0,0 @@ -import scala.util.continuations._ - -object Test { - abstract class IfReturnRepro { - def s1: Double @cpsParam[Any, Unit] - def s2: Double @cpsParam[Any, Unit] - - def p(i: Int): Double @cpsParam[Unit, Any] = { - val px = s1 - val pct = if (px > 100) px else px / s2 - println("pct = %.3f".format(pct)) - pct - } - } - - def main(args: Array[String]) : Unit = { - var d: Double = 0d - def d2 = d * d - - val irr = new IfReturnRepro { - def s1 = shift(f => f(d)) - def s2 = shift(f => f(d2)) - } - 1 to 25 foreach { i => - d = i - print("d = " + i + ", d2 = " + d2 + ", ") - run(irr p i) - } - } -} diff --git a/test/files/continuations-run/t1807.check b/test/files/continuations-run/t1807.check deleted file mode 100644 index 56a6051ca2..0000000000 --- a/test/files/continuations-run/t1807.check +++ /dev/null @@ -1 +0,0 @@ -1
\ No newline at end of file diff --git a/test/files/continuations-run/t1807.scala b/test/files/continuations-run/t1807.scala deleted file mode 100644 index 278b3a9936..0000000000 --- a/test/files/continuations-run/t1807.scala +++ /dev/null @@ -1,14 +0,0 @@ -// $Id$ - -import scala.util.continuations._ - - -object Test { - def main(args: Array[String]): Unit = { - val z = reset { - val f: (() => Int @cps[Int]) = () => 1 - f() - } - println(z) - } -}
\ No newline at end of file diff --git a/test/files/continuations-run/t1808.scala b/test/files/continuations-run/t1808.scala deleted file mode 100644 index 125c7c1cdf..0000000000 --- a/test/files/continuations-run/t1808.scala +++ /dev/null @@ -1,10 +0,0 @@ -// $Id$ - -import scala.util.continuations._ - - -object Test { - def main(args: Array[String]): Unit = { - reset0 { 0 } - } -}
\ No newline at end of file diff --git a/test/files/continuations-run/t1820.scala b/test/files/continuations-run/t1820.scala deleted file mode 100644 index 7de6ccabef..0000000000 --- a/test/files/continuations-run/t1820.scala +++ /dev/null @@ -1,14 +0,0 @@ -// $Id$ - -import scala.util.continuations._ - - -object Test { - def shifted: Unit @suspendable = shift { (k: Unit => Unit) => () } - def test1(b: => Boolean) = { - reset { - if (b) shifted - } - } - def main(args: Array[String]): Unit = test1(true) -} diff --git a/test/files/continuations-run/t1821.check b/test/files/continuations-run/t1821.check deleted file mode 100644 index f7b76115db..0000000000 --- a/test/files/continuations-run/t1821.check +++ /dev/null @@ -1,4 +0,0 @@ -() -() -() -()
\ No newline at end of file diff --git a/test/files/continuations-run/t1821.scala b/test/files/continuations-run/t1821.scala deleted file mode 100644 index 55bf7b6f12..0000000000 --- a/test/files/continuations-run/t1821.scala +++ /dev/null @@ -1,20 +0,0 @@ -// $Id$ - -import scala.util.continuations._ - - -object Test { - def suspended[A](x: A): A @suspendable = x - def test1[A](x: A): A @suspendable = suspended(x) match { case x => x } - def test2[A](x: List[A]): A @suspendable = suspended(x) match { case List(x) => x } - - def test3[A](x: A): A @suspendable = x match { case x => x } - def test4[A](x: List[A]): A @suspendable = x match { case List(x) => x } - - def main(args: Array[String]) { - println(reset(test1())) - println(reset(test2(List(())))) - println(reset(test3())) - println(reset(test4(List(())))) - } -} diff --git a/test/files/continuations-run/t2864.check b/test/files/continuations-run/t2864.check deleted file mode 100644 index d411bb7c1a..0000000000 --- a/test/files/continuations-run/t2864.check +++ /dev/null @@ -1 +0,0 @@ -400 diff --git a/test/files/continuations-run/t2864.scala b/test/files/continuations-run/t2864.scala deleted file mode 100644 index 7a2579e45c..0000000000 --- a/test/files/continuations-run/t2864.scala +++ /dev/null @@ -1,30 +0,0 @@ -import scala.util.continuations._ -object Test { - - def double[B](n : Int)(k : Int => B) : B = k(n * 2) - - def main(args : Array[String]) { - reset { - val result1 = shift(double[Unit](100)) - val result2 = shift(double[Unit](result1)) - println(result2) - } - } - - def foo: Int @cps[Int] = { - val a0 = shift((k:Int=>Int) => k(0)) - val x0 = 2 - val a1 = shift((k:Int=>Int) => x0) - 0 - } - -/* - def bar: ControlContext[Int,Int,Int] = { - shiftR((k:Int=>Int) => k(0)).flatMap { a0 => - val x0 = 2 - shiftR((k:Int=>Int) => x0).map { a1 => - 0 - }} - } -*/ -}
\ No newline at end of file diff --git a/test/files/continuations-run/t2934.check b/test/files/continuations-run/t2934.check deleted file mode 100644 index a92586538e..0000000000 --- a/test/files/continuations-run/t2934.check +++ /dev/null @@ -1 +0,0 @@ -List(3, 4, 5) diff --git a/test/files/continuations-run/t2934.scala b/test/files/continuations-run/t2934.scala deleted file mode 100644 index a1b8ca9e04..0000000000 --- a/test/files/continuations-run/t2934.scala +++ /dev/null @@ -1,10 +0,0 @@ -import scala.util.continuations._ - -object Test { - def main(args : Array[String]) { - println(reset { - val x = shift(List(1,2,3).flatMap[Int, List[Int]]) - List(x + 2) - }) - } -} diff --git a/test/files/continuations-run/t3199.check b/test/files/continuations-run/t3199.check deleted file mode 100644 index a065247b8c..0000000000 --- a/test/files/continuations-run/t3199.check +++ /dev/null @@ -1 +0,0 @@ -Right(7) diff --git a/test/files/continuations-run/t3199.scala b/test/files/continuations-run/t3199.scala deleted file mode 100644 index 2cb73c005a..0000000000 --- a/test/files/continuations-run/t3199.scala +++ /dev/null @@ -1,20 +0,0 @@ -import _root_.scala.collection.Seq -import _root_.scala.util.control.Exception -import _root_.scala.util.continuations._ - -object Test { - - trait AbstractResource[+R <: AnyRef] { - def reflect[B] : R @cpsParam[B,Either[Throwable, B]] = shift(acquireFor) - def acquireFor[B](f : R => B) : Either[Throwable, B] = { - import Exception._ - catching(List(classOf[Throwable]) : _*) either (f(null.asInstanceOf[R])) - } - } - - def main(args: Array[String]) : Unit = { - val x = new AbstractResource[String] { } - val result = x.acquireFor( x => 7 ) - println(result) - } - } diff --git a/test/files/continuations-run/t3199b.check b/test/files/continuations-run/t3199b.check deleted file mode 100644 index b5d8bb58d9..0000000000 --- a/test/files/continuations-run/t3199b.check +++ /dev/null @@ -1 +0,0 @@ -[1, 2, 3] diff --git a/test/files/continuations-run/t3199b.scala b/test/files/continuations-run/t3199b.scala deleted file mode 100644 index 5010f2b085..0000000000 --- a/test/files/continuations-run/t3199b.scala +++ /dev/null @@ -1,11 +0,0 @@ -object Test { - - def test() = { - java.util.Arrays.asList(Array(1,2,3):_*) - } - - def main(args: Array[String]) { - println(test()) - } - -} diff --git a/test/files/continuations-run/t3223.check b/test/files/continuations-run/t3223.check deleted file mode 100644 index ec635144f6..0000000000 --- a/test/files/continuations-run/t3223.check +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/test/files/continuations-run/t3223.scala b/test/files/continuations-run/t3223.scala deleted file mode 100644 index 75613fe5c7..0000000000 --- a/test/files/continuations-run/t3223.scala +++ /dev/null @@ -1,19 +0,0 @@ -import scala.util.continuations._ -object Test { - - def foo(x:Int) = { - try { - throw new Exception - shiftUnit0[Int,Int](7) - } catch { - case ex: Throwable => - val g = (a:Int)=>a - 9 - } - } - - def main(args: Array[String]) { - println(reset(foo(0))) - } - -} diff --git a/test/files/continuations-run/t3225.check b/test/files/continuations-run/t3225.check deleted file mode 100644 index df1a8a9ce4..0000000000 --- a/test/files/continuations-run/t3225.check +++ /dev/null @@ -1,12 +0,0 @@ -8 -8 -9 -9 -8 -9 -8 -8 -9 -9 -8 -9 diff --git a/test/files/continuations-run/t3225.scala b/test/files/continuations-run/t3225.scala deleted file mode 100644 index a0c9c91985..0000000000 --- a/test/files/continuations-run/t3225.scala +++ /dev/null @@ -1,56 +0,0 @@ -// $Id$ - -import scala.util.continuations._ - - -object Test { - - class Bla { - val x = 8 - def y[T] = 9 - } - -/* - def bla[A] = shift { k:(Bla=>A) => k(new Bla) } -*/ - - def bla1 = shift { k:(Bla=>Bla) => k(new Bla) } - def bla2 = shift { k:(Bla=>Int) => k(new Bla) } - - def fooA = bla2.x - def fooB[T] = bla2.y[T] - - def testMono() = { - println(reset(bla1).x) - println(reset(bla2.x)) - println(reset(bla2.y[Int])) - println(reset(bla2.y)) - println(reset(fooA)) - println(reset(fooB)) - 0 - } - - def blaX[A] = shift { k:(Bla=>A) => k(new Bla) } - - def fooX[A] = blaX[A].x - def fooY[A] = blaX[A].y[A] - - def testPoly() = { - println(reset(blaX[Bla]).x) - println(reset(blaX[Int].x)) - println(reset(blaX[Int].y[Int])) - println(reset(blaX[Int].y)) - println(reset(fooX[Int])) - println(reset(fooY[Int])) - 0 - } - - - // TODO: check whether this also applies to a::shift { k => ... } - - def main(args: Array[String]) { - testMono() - testPoly() - } - -} diff --git a/test/files/continuations-run/t3501.check b/test/files/continuations-run/t3501.check deleted file mode 100644 index 08adcfe27a..0000000000 --- a/test/files/continuations-run/t3501.check +++ /dev/null @@ -1,5 +0,0 @@ -42 -42 -42 -42 -42 diff --git a/test/files/continuations-run/t3501.scala b/test/files/continuations-run/t3501.scala deleted file mode 100644 index c43b3322be..0000000000 --- a/test/files/continuations-run/t3501.scala +++ /dev/null @@ -1,15 +0,0 @@ -import scala.util.continuations._ - -object Test { - def capture(): Int @suspendable = 42 - - def main(args: Array[String]): Unit = reset { - var i = 0 - while (i < 5) { - i += 1 - val y = capture() - val s = y - println(s) - } - } -} diff --git a/test/files/continuations-run/t5314-2.check b/test/files/continuations-run/t5314-2.check deleted file mode 100644 index 35b3c93780..0000000000 --- a/test/files/continuations-run/t5314-2.check +++ /dev/null @@ -1,5 +0,0 @@ -8 -hi -8 -from try -8 diff --git a/test/files/continuations-run/t5314-2.scala b/test/files/continuations-run/t5314-2.scala deleted file mode 100644 index e7e5d46f03..0000000000 --- a/test/files/continuations-run/t5314-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/t5314-3.check b/test/files/continuations-run/t5314-3.check deleted file mode 100644 index 71489f097c..0000000000 --- a/test/files/continuations-run/t5314-3.check +++ /dev/null @@ -1,4 +0,0 @@ -enter return expr -8 -hi -8 diff --git a/test/files/continuations-run/t5314-3.scala b/test/files/continuations-run/t5314-3.scala deleted file mode 100644 index c2fe8f6f87..0000000000 --- a/test/files/continuations-run/t5314-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/t5314-with-if.check b/test/files/continuations-run/t5314-with-if.check deleted file mode 100644 index 7f8f011eb7..0000000000 --- a/test/files/continuations-run/t5314-with-if.check +++ /dev/null @@ -1 +0,0 @@ -7 diff --git a/test/files/continuations-run/t5314-with-if.scala b/test/files/continuations-run/t5314-with-if.scala deleted file mode 100644 index 5840199a3c..0000000000 --- a/test/files/continuations-run/t5314-with-if.scala +++ /dev/null @@ -1,17 +0,0 @@ -import scala.util.continuations._ - -object Test extends App { - - def foo(x:Int): Int @cps[Int] = 7 - - def bar(x:Int): Int @cps[Int] = { - val v = foo(x) - if (v > 0) - return v - else - return 10 - } - - println(reset { bar(10) }) - -} diff --git a/test/files/continuations-run/t5314.check b/test/files/continuations-run/t5314.check deleted file mode 100644 index 61f5b25dc7..0000000000 --- a/test/files/continuations-run/t5314.check +++ /dev/null @@ -1,14 +0,0 @@ -t5314.scala:34: warning: expression 7 is cps-transformed unexpectedly - def bar3(x:Int): Int @cps[Int] = { foo2(x); if (x == 7) return 7 else return foo2(x) } - ^ -t5314.scala:35: warning: expression 7 is cps-transformed unexpectedly - def bar4(x:Int): Int @cps[Int] = { foo2(x); if (x == 7) return 7 else foo2(x) } - ^ -7 -7 -7 -8 -8 -hi -8 -8 diff --git a/test/files/continuations-run/t5314.scala b/test/files/continuations-run/t5314.scala deleted file mode 100644 index e448d8558d..0000000000 --- a/test/files/continuations-run/t5314.scala +++ /dev/null @@ -1,52 +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 { - def foo(x:Int): Int @cps[Int] = shift { k => k(x) } - - def bar(x:Int): Int @cps[Int] = return foo(x) - - 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 - - reset { - val res = bar(8) - println(res) - res - } -} diff --git a/test/files/continuations-run/t5472.check b/test/files/continuations-run/t5472.check deleted file mode 100644 index 2468b6b27d..0000000000 --- a/test/files/continuations-run/t5472.check +++ /dev/null @@ -1,25 +0,0 @@ -t5472.scala:12: warning: expression case4(){ - if (x1.ne(null)) - matchEnd3(true) - else - case5() -} is cps-transformed unexpectedly - (location, accessors) <- new ContinuationizedParallelIterable(map) - ^ -t5472.scala:12: warning: expression case5(){ - matchEnd3(false) -} is cps-transformed unexpectedly - (location, accessors) <- new ContinuationizedParallelIterable(map) - ^ -t5472.scala:12: warning: expression matchEnd3(x: Boolean){ - x -} is cps-transformed unexpectedly - (location, accessors) <- new ContinuationizedParallelIterable(map) - ^ -t5472.scala:12: warning: expression matchEnd3(x: Int){ - x -} is cps-transformed unexpectedly - (location, accessors) <- new ContinuationizedParallelIterable(map) - ^ -warning: there were 1 deprecation warning(s); re-run with -deprecation for details -List(23, 23) diff --git a/test/files/continuations-run/t5472.scala b/test/files/continuations-run/t5472.scala deleted file mode 100644 index 060d267544..0000000000 --- a/test/files/continuations-run/t5472.scala +++ /dev/null @@ -1,91 +0,0 @@ -import scala.annotation._ -import scala.util.continuations._ -import java.util.concurrent.atomic._ - -@deprecated("Suppress warnings", since="2.11") -object Test { - def main(args: Array[String]) { - val map = Map("foo" -> 1, "bar" -> 2) - reset { - val mapped = - for { - (location, accessors) <- new ContinuationizedParallelIterable(map) - } yield { - shiftUnit0[Int, Unit](23) - } - println(mapped.toList) - } - } - -final class ContinuationizedParallelIterable[+A](protected val underline: Iterable[A]) { - def toList = underline.toList.sortBy(_.toString) - - final def filter(p: A => Boolean @suspendable): ContinuationizedParallelIterable[A] @suspendable = - shift( - new AtomicInteger(1) with ((ContinuationizedParallelIterable[A] => Unit) => Unit) { - private val results = new AtomicReference[List[A]](Nil) - - @tailrec - private def add(element: A) { - val old = results.get - if (!results.compareAndSet(old, element :: old)) { - add(element) - } - } - - override final def apply(continue: ContinuationizedParallelIterable[A] => Unit) { - for (element <- underline) { - super.incrementAndGet() - reset { - val pass = p(element) - if (pass) { - add(element) - } - if (super.decrementAndGet() == 0) { - continue(new ContinuationizedParallelIterable(results.get)) - } - } - } - if (super.decrementAndGet() == 0) { - continue(new ContinuationizedParallelIterable(results.get)) - } - } - }) - - final def foreach[U](f: A => U @suspendable): Unit @suspendable = - shift( - new AtomicInteger(1) with ((Unit => Unit) => Unit) { - override final def apply(continue: Unit => Unit) { - for (element <- underline) { - super.incrementAndGet() - reset { - f(element) - if (super.decrementAndGet() == 0) { - continue() - } - } - } - if (super.decrementAndGet() == 0) { - continue() - } - } - }) - - final def map[B: Manifest](f: A => B @suspendable): ContinuationizedParallelIterable[B] @suspendable = - shift( - new AtomicInteger(underline.size) with ((ContinuationizedParallelIterable[B] => Unit) => Unit) { - override final def apply(continue: ContinuationizedParallelIterable[B] => Unit) { - val results = new Array[B](super.get) - for ((element, i) <- underline.view.zipWithIndex) { - reset { - val result = f(element) - results(i) = result - if (super.decrementAndGet() == 0) { - continue(new ContinuationizedParallelIterable(results)) - } - } - } - } - }) -} -} diff --git a/test/files/continuations-run/t5506.check b/test/files/continuations-run/t5506.check deleted file mode 100644 index 38b76c63f1..0000000000 --- a/test/files/continuations-run/t5506.check +++ /dev/null @@ -1,7 +0,0 @@ -List(1, 2, 3) -List(1, 2, 3) -List(1, 2, 3) -List(1, 2, 3) -List(1, 2, 3) -List(1, 2, 3) -List(1, 2, 3) diff --git a/test/files/continuations-run/t5506.scala b/test/files/continuations-run/t5506.scala deleted file mode 100644 index 08f64c9db1..0000000000 --- a/test/files/continuations-run/t5506.scala +++ /dev/null @@ -1,58 +0,0 @@ -import scala.util.continuations._ - -object Test { - -def g: List[Int] @suspendable = List(1,2,3) - -def fp10: List[Int] @suspendable = { -g.map(x => x) -} - -def fp11: List[Int] @suspendable = { -val z = g.map(x => x) -z -} - - -def fp12: List[Int] @suspendable = { -val z = List(1,2,3) -z.map(x => x) -} - - - -def fp20: List[Int] @suspendable = { -g.map[Int,List[Int]](x => x) -} - - -def fp21: List[Int] @suspendable = { -val z = g.map[Int,List[Int]](x => x) -z -} - -def fp22: List[Int] @suspendable = { -val z = g.map[Int,List[Int]](x => x)(List.canBuildFrom[Int]) -z -} - -def fp23: List[Int] @suspendable = { -val z = g.map(x => x)(List.canBuildFrom[Int]) -z -} - - -def main(args: Array[String]) { - reset { - println(fp10) - println(fp11) - println(fp12) - - println(fp20) - println(fp21) - println(fp22) - println(fp23) - } -} - -} diff --git a/test/files/continuations-run/t5538.check b/test/files/continuations-run/t5538.check deleted file mode 100644 index d9d873663d..0000000000 --- a/test/files/continuations-run/t5538.check +++ /dev/null @@ -1,2 +0,0 @@ -warning: there were 1 feature warning(s); re-run with -feature for details -Future(Future(Future(Future(Future(List(1, 2, 3, 4, 5)))))) diff --git a/test/files/continuations-run/t5538.scala b/test/files/continuations-run/t5538.scala deleted file mode 100644 index 9f01624da1..0000000000 --- a/test/files/continuations-run/t5538.scala +++ /dev/null @@ -1,52 +0,0 @@ -import scala.util.continuations._ -import scala.collection.generic.CanBuildFrom - -import scala.language.{ implicitConversions } - -object Test { - - class ExecutionContext - - implicit def defaultExecutionContext = new ExecutionContext - - case class Future[+T](x:T) { - final def map[A](f: T => A): Future[A] = new Future[A](f(x)) - final def flatMap[A](f: T => Future[A]): Future[A] = f(x) - } - - class PromiseStream[A] { - override def toString = xs.toString - - var xs: List[A] = Nil - - final def +=(elem: A): this.type = { xs :+= elem; this } - - final def ++=(elem: Traversable[A]): this.type = { xs ++= elem; this } - - final def <<(elem: Future[A]): PromiseStream[A] @cps[Future[Any]] = - shift { cont: (PromiseStream[A] => Future[Any]) => elem map (a => cont(this += a)) } - - final def <<(elem1: Future[A], elem2: Future[A], elems: Future[A]*): PromiseStream[A] @cps[Future[Any]] = - shift { cont: (PromiseStream[A] => Future[Any]) => Future.flow(this << elem1 << elem2 <<< Future.sequence(elems.toSeq)) map cont } - - final def <<<(elems: Traversable[A]): PromiseStream[A] @cps[Future[Any]] = - shift { cont: (PromiseStream[A] => Future[Any]) => cont(this ++= elems) } - - final def <<<(elems: Future[Traversable[A]]): PromiseStream[A] @cps[Future[Any]] = - shift { cont: (PromiseStream[A] => Future[Any]) => elems map (as => cont(this ++= as)) } - } - - object Future { - - def sequence[A, M[_] <: Traversable[_]](in: M[Future[A]])(implicit cbf: CanBuildFrom[M[Future[A]], A, M[A]], executor: ExecutionContext): Future[M[A]] = - new Future(in.asInstanceOf[Traversable[Future[A]]].map((f:Future[A])=>f.x)(cbf.asInstanceOf[CanBuildFrom[Traversable[Future[A]], A, M[A]]])) - - def flow[A](body: => A @cps[Future[Any]])(implicit executor: ExecutionContext): Future[A] = reset(Future(body)).asInstanceOf[Future[A]] - - } - - def main(args: Array[String]) { - val p = new PromiseStream[Int] - println(Future.flow(p << (Future(1), Future(2), Future(3), Future(4), Future(5)))) - } -} diff --git a/test/files/continuations-run/trycatch0.check b/test/files/continuations-run/trycatch0.check deleted file mode 100644 index 36806909d0..0000000000 --- a/test/files/continuations-run/trycatch0.check +++ /dev/null @@ -1,2 +0,0 @@ -10 -10
\ No newline at end of file diff --git a/test/files/continuations-run/trycatch0.scala b/test/files/continuations-run/trycatch0.scala deleted file mode 100644 index d0b4a52a30..0000000000 --- a/test/files/continuations-run/trycatch0.scala +++ /dev/null @@ -1,25 +0,0 @@ -// $Id$ - -import scala.util.continuations._ - -object Test { - - def foo = try { - shift((k: Int=>Int) => k(7)) - } catch { - case ex: Throwable => - 9 - } - - def bar = try { - 7 - } catch { - case ex: Throwable => - shiftUnit0[Int,Int](9) - } - - def main(args: Array[String]): Unit = { - println(reset { foo + 3 }) - println(reset { bar + 3 }) - } -} diff --git a/test/files/continuations-run/trycatch1.check b/test/files/continuations-run/trycatch1.check deleted file mode 100644 index 061ecdcd54..0000000000 --- a/test/files/continuations-run/trycatch1.check +++ /dev/null @@ -1,10 +0,0 @@ -trycatch1.scala:34: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses - 7 - ^ -trycatch1.scala:18: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses - shift((k: Int=>Int) => k(7)) - ^ -12 -12 -12 -12 diff --git a/test/files/continuations-run/trycatch1.scala b/test/files/continuations-run/trycatch1.scala deleted file mode 100644 index 2a8db72a8b..0000000000 --- a/test/files/continuations-run/trycatch1.scala +++ /dev/null @@ -1,48 +0,0 @@ -// $Id$ - -import scala.util.continuations._ - -object Test { - - def fatal: Int = throw new Exception() - - def foo1 = try { - fatal - shift((k: Int=>Int) => k(7)) - } catch { - case ex: Throwable => - 9 - } - - def foo2 = try { - shift((k: Int=>Int) => k(7)) - fatal - } catch { - case ex: Throwable => - 9 - } - - def bar1 = try { - fatal - 7 - } catch { - case ex: Throwable => - shiftUnit0[Int,Int](9) // regular shift causes no-symbol doesn't have owner - } - - def bar2 = try { - 7 - fatal - } catch { - case ex: Throwable => - shiftUnit0[Int,Int](9) // regular shift causes no-symbol doesn't have owner - } - - def main(args: Array[String]): Unit = { - println(reset { foo1 + 3 }) - println(reset { foo2 + 3 }) - println(reset { bar1 + 3 }) - println(reset { bar2 + 3 }) - } - -} diff --git a/test/files/continuations-run/while0.check b/test/files/continuations-run/while0.check deleted file mode 100644 index d58c55a31d..0000000000 --- a/test/files/continuations-run/while0.check +++ /dev/null @@ -1 +0,0 @@ -9000 diff --git a/test/files/continuations-run/while0.scala b/test/files/continuations-run/while0.scala deleted file mode 100644 index e21745374e..0000000000 --- a/test/files/continuations-run/while0.scala +++ /dev/null @@ -1,22 +0,0 @@ -// $Id$ - -import scala.util.continuations._ - - -object Test { - - def foo(): Int @cps[Unit] = 2 - - def test(): Unit @cps[Unit] = { - var x = 0 - while (x < 9000) { // pick number large enough to require tail-call opt - x += foo() - } - println(x) - } - - def main(args: Array[String]): Unit = { - reset(test()) - } - -} diff --git a/test/files/continuations-run/while1.check b/test/files/continuations-run/while1.check deleted file mode 100644 index 3d5f0b9a46..0000000000 --- a/test/files/continuations-run/while1.check +++ /dev/null @@ -1,11 +0,0 @@ -up -up -up -up -up -10 -down -down -down -down -down diff --git a/test/files/continuations-run/while1.scala b/test/files/continuations-run/while1.scala deleted file mode 100644 index 7ba9f94881..0000000000 --- a/test/files/continuations-run/while1.scala +++ /dev/null @@ -1,22 +0,0 @@ -// $Id$ - -import scala.util.continuations._ - - -object Test { - - def foo(): Int @cps[Unit] = shift { k => println("up"); k(2); println("down") } - - def test(): Unit @cps[Unit] = { - var x = 0 - while (x < 9) { - x += foo() - } - println(x) - } - - def main(args: Array[String]): Unit = { - reset(test()) - } - -} diff --git a/test/files/continuations-run/while2.check b/test/files/continuations-run/while2.check deleted file mode 100644 index 9fe515181b..0000000000 --- a/test/files/continuations-run/while2.check +++ /dev/null @@ -1,19 +0,0 @@ -up -up -up -up -up -up -up -up -up -9000 -down -down -down -down -down -down -down -down -down diff --git a/test/files/continuations-run/while2.scala b/test/files/continuations-run/while2.scala deleted file mode 100644 index 3dbf2ad2fe..0000000000 --- a/test/files/continuations-run/while2.scala +++ /dev/null @@ -1,23 +0,0 @@ -// $Id$ - -import scala.util.continuations._ - - -object Test { - - def foo1(): Int @cps[Unit] = 2 - def foo2(): Int @cps[Unit] = shift { k => println("up"); k(2); println("down") } - - def test(): Unit @cps[Unit] = { - var x = 0 - while (x < 9000) { // pick number large enough to require tail-call opt - x += (if (x % 1000 != 0) foo1() else foo2()) - } - println(x) - } - - def main(args: Array[String]): Unit = { - reset(test()) - } - -} diff --git a/test/files/continuations-run/z1673.scala b/test/files/continuations-run/z1673.scala deleted file mode 100644 index 716b374860..0000000000 --- a/test/files/continuations-run/z1673.scala +++ /dev/null @@ -1,31 +0,0 @@ -import scala.util.continuations._ - -class MatchRepro { - def s: String @cps[Any] = shift { k => k("foo") } - - def p = { - val k = s - s match { case lit0 => } - } - - def q = { - val k = s - k match { case lit1 => } - } - - def r = { - s match { case "FOO" => } - } - - def t = { - val k = s - k match { case "FOO" => } - } -} - -object Test { - def main(args: Array[String]): Unit = { - val m = new MatchRepro - () - } -} |