From f584d243487dcd1214291167707e2f53fef5ab5e Mon Sep 17 00:00:00 2001 From: Tiark Rompf Date: Thu, 11 Mar 2010 16:55:38 +0000 Subject: moved the continuations plugin into trunk. --- test/files/continuations-run/ifelse3.scala | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/files/continuations-run/ifelse3.scala (limited to 'test/files/continuations-run/ifelse3.scala') diff --git a/test/files/continuations-run/ifelse3.scala b/test/files/continuations-run/ifelse3.scala new file mode 100644 index 0000000000..5dbd079d1c --- /dev/null +++ b/test/files/continuations-run/ifelse3.scala @@ -0,0 +1,21 @@ +// $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]): Any = { + println(reset(test(7))) + println(reset(test(8))) + } + +} \ No newline at end of file -- cgit v1.2.3