aboutsummaryrefslogtreecommitdiff
path: root/tests/untried/pos/simple-exceptions.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/untried/pos/simple-exceptions.scala')
-rw-r--r--tests/untried/pos/simple-exceptions.scala20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/untried/pos/simple-exceptions.scala b/tests/untried/pos/simple-exceptions.scala
new file mode 100644
index 000000000..a9f16bf90
--- /dev/null
+++ b/tests/untried/pos/simple-exceptions.scala
@@ -0,0 +1,20 @@
+import java.io.IOException;
+
+object Test {
+
+ //def error[a](x: String):a = new java.lang.RuntimeException(x) throw;
+
+ def main(args: Array[String]): Unit = {
+ try {
+ try {
+ Console.println("hi!")
+ sys.error("xx")
+ }
+ finally Console.println("ho!")
+ }
+ catch {
+ case ex: IOException => Console.println("io exception!");
+ case ex => Console.println(ex);
+ }
+ }
+}