diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2007-03-26 12:53:18 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2007-03-26 12:53:18 +0000 |
commit | d27455c099f1f2e4b429521ae54e503063823784 (patch) | |
tree | c1e93121fab6f8137925403391fa6eac87c66338 /test/files/run/exceptions-2.scala | |
parent | e2ec34436ea22b62d091be0bb56a577f0e0c4c07 (diff) | |
download | scala-d27455c099f1f2e4b429521ae54e503063823784.tar.gz scala-d27455c099f1f2e4b429521ae54e503063823784.tar.bz2 scala-d27455c099f1f2e4b429521ae54e503063823784.zip |
Added test case for bug #1020.
Diffstat (limited to 'test/files/run/exceptions-2.scala')
-rw-r--r-- | test/files/run/exceptions-2.scala | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/test/files/run/exceptions-2.scala b/test/files/run/exceptions-2.scala index e9a7eea963..3802297d84 100644 --- a/test/files/run/exceptions-2.scala +++ b/test/files/run/exceptions-2.scala @@ -4,7 +4,6 @@ * $Id$ */ - trait Tree extends Exception; case class Node(a: Tree, b: Tree) extends Tree; @@ -210,8 +209,22 @@ object Test { return } - - + /** bug #1020, no crash at compile time */ + def tryCatchInFinally: Unit = { + try { + Console.println("Try") + } catch { + case e:java.io.IOException => + throw e + } finally { + val x = 10 + // Always make sure result sets and statements are closed, + // and the connection is returned to the pool + if (x != 10) { + try { Console.println("Fin"); } catch { case e:java.io.IOException => ; } + } + } + } def execute(f: => Unit) = try { f; |