summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2007-03-26 12:53:18 +0000
committerIulian Dragos <jaguarul@gmail.com>2007-03-26 12:53:18 +0000
commitd27455c099f1f2e4b429521ae54e503063823784 (patch)
treec1e93121fab6f8137925403391fa6eac87c66338 /test
parente2ec34436ea22b62d091be0bb56a577f0e0c4c07 (diff)
downloadscala-d27455c099f1f2e4b429521ae54e503063823784.tar.gz
scala-d27455c099f1f2e4b429521ae54e503063823784.tar.bz2
scala-d27455c099f1f2e4b429521ae54e503063823784.zip
Added test case for bug #1020.
Diffstat (limited to 'test')
-rw-r--r--test/files/run/exceptions-2.scala19
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;