diff options
Diffstat (limited to 'test/continuations/run/trycatch0.scala')
-rw-r--r-- | test/continuations/run/trycatch0.scala | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/continuations/run/trycatch0.scala b/test/continuations/run/trycatch0.scala new file mode 100644 index 0000000000..74a078b5ef --- /dev/null +++ b/test/continuations/run/trycatch0.scala @@ -0,0 +1,25 @@ +// $Id$ + +import scala.util.continuations._ + +object Test { + + def foo = try { + shift((k: Int=>Int) => k(7)) + } catch { + case ex => + 9 + } + + def bar = try { + 7 + } catch { + case ex => + shiftUnit0[Int,Int](9) + } + + def main(args: Array[String]): Unit = { + println(reset { foo + 3 }) + println(reset { bar + 3 }) + } +}
\ No newline at end of file |