summaryrefslogtreecommitdiff
path: root/test/files/continuations-neg/trycatch2.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/continuations-neg/trycatch2.scala')
-rw-r--r--test/files/continuations-neg/trycatch2.scala33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/files/continuations-neg/trycatch2.scala b/test/files/continuations-neg/trycatch2.scala
new file mode 100644
index 0000000000..761cee52ac
--- /dev/null
+++ b/test/files/continuations-neg/trycatch2.scala
@@ -0,0 +1,33 @@
+// $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 =>
+ cpsIntStringInt
+ }
+
+ def foo2 = try {
+ fatal[Int]
+ cpsIntStringInt
+ } catch {
+ case ex =>
+ cpsIntStringInt
+ }
+
+
+ def main(args: Array[String]): Unit = {
+ println(reset { foo1; "3" })
+ println(reset { foo2; "3" })
+ }
+
+} \ No newline at end of file