aboutsummaryrefslogtreecommitdiff
path: root/tests/run/liftedTry.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run/liftedTry.scala')
-rw-r--r--tests/run/liftedTry.scala12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/run/liftedTry.scala b/tests/run/liftedTry.scala
index 2e4c25c2b..0d956fc1f 100644
--- a/tests/run/liftedTry.scala
+++ b/tests/run/liftedTry.scala
@@ -12,10 +12,20 @@ object Test {
foo(try 3 catch handle)
- def main(args: Array[String]) = {
+ def main(args: Array[String]): Unit = {
assert(x == 1)
assert(foo(2) == 2)
assert(foo(try raise(3) catch handle) == 3)
+ Tr.foo
}
}
+
+object Tr {
+ def fun(a: Int => Unit) = a(2)
+ def foo: Int = {
+ var s = 1
+ s = try {fun(s = _); 3} catch{ case ex: Throwable => s = 4; 5 }
+ s
+ }
+}