summaryrefslogtreecommitdiff
path: root/test/files/run/try-catch-unify.scala
diff options
context:
space:
mode:
authorJosh Suereth <joshua.suereth@gmail.com>2012-08-20 12:12:50 -0400
committerJosh Suereth <joshua.suereth@gmail.com>2012-08-20 12:12:50 -0400
commit24502208feff83d6a7b8197f5051856ec5cf9983 (patch)
tree0791f88eb4d0fa0fcf2f7303272d9a9ac10893a4 /test/files/run/try-catch-unify.scala
parent74e3b4dc8b85b0f861ce9a87e8765654a3ac40f8 (diff)
downloadscala-24502208feff83d6a7b8197f5051856ec5cf9983.tar.gz
scala-24502208feff83d6a7b8197f5051856ec5cf9983.tar.bz2
scala-24502208feff83d6a7b8197f5051856ec5cf9983.zip
Adding test for try-catch library unification.
Diffstat (limited to 'test/files/run/try-catch-unify.scala')
-rw-r--r--test/files/run/try-catch-unify.scala15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/files/run/try-catch-unify.scala b/test/files/run/try-catch-unify.scala
new file mode 100644
index 0000000000..0d819ab957
--- /dev/null
+++ b/test/files/run/try-catch-unify.scala
@@ -0,0 +1,15 @@
+import util._
+
+import control.Exception._
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ println(catching(classOf[NumberFormatException]) withTry ("Hi".toDouble))
+ println(catching(classOf[NumberFormatException]) withTry ("5".toDouble))
+ try {
+ catching(classOf[NumberFormatException]) withTry (sys.error("O NOES"))
+ } catch {
+ case t => println(t.getMessage)
+ }
+ }
+}