From a7ea09750252edb05465232db0ee2e4ed8ac4039 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Fri, 13 Mar 2009 16:48:57 +0000 Subject: Modifies try/catch/finally to allow arbitrary e... Modifies try/catch/finally to allow arbitrary expressions for try. Formerly { ... } was required for try. Now expressions like: val x = try Integer.parseInt("xx") catch { case e => 10 } work as one would hope. --- test/files/pos/tryexpr.scala | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 test/files/pos/tryexpr.scala (limited to 'test') diff --git a/test/files/pos/tryexpr.scala b/test/files/pos/tryexpr.scala new file mode 100644 index 0000000000..c16428e7a5 --- /dev/null +++ b/test/files/pos/tryexpr.scala @@ -0,0 +1,10 @@ +// stretching more flexible try/catch's legs a bit +object o { + try Integer.parseInt("xxxx") catch { case e => 5 } + try 5 + try try try 10 + try try try 10 catch { case e => 20 } finally 30 + try try try 10 catch { case e => 20 } finally 30 finally 40 + try try try 10 catch { case e => 20 } finally 30 finally 40 finally 50 + try try try 10 finally 50 +} \ No newline at end of file -- cgit v1.2.3