diff options
author | Tiark Rompf <tiark.rompf@epfl.ch> | 2010-03-16 08:19:59 +0000 |
---|---|---|
committer | Tiark Rompf <tiark.rompf@epfl.ch> | 2010-03-16 08:19:59 +0000 |
commit | 166c496d5784d0be3611b270d9eba39f1273e048 (patch) | |
tree | bb52feed6cd9221f98d36edf9da303336098ad89 /test/files/continuations-run/trycatch0.scala | |
parent | 324eeff963585af9248885473beeabfe8770ed68 (diff) | |
download | scala-166c496d5784d0be3611b270d9eba39f1273e048.tar.gz scala-166c496d5784d0be3611b270d9eba39f1273e048.tar.bz2 scala-166c496d5784d0be3611b270d9eba39f1273e048.zip |
added support for continuations in try/catch bl...
added support for continuations in try/catch blocks. review by
community.
Diffstat (limited to 'test/files/continuations-run/trycatch0.scala')
-rw-r--r-- | test/files/continuations-run/trycatch0.scala | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/files/continuations-run/trycatch0.scala b/test/files/continuations-run/trycatch0.scala new file mode 100644 index 0000000000..74a078b5ef --- /dev/null +++ b/test/files/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 |