diff options
author | Dmitry Petrashko <dark@d-d.me> | 2015-08-20 14:59:47 +0200 |
---|---|---|
committer | Dmitry Petrashko <dark@d-d.me> | 2015-08-20 14:59:47 +0200 |
commit | eec8191fc067358f88bec56d7dbda36e1fcfc131 (patch) | |
tree | 3e76fcae6e6b7ed8eb75444a5c756944a464c542 /tests/run | |
parent | dbbc5ca47bc3485f735682c89f8f4cd07c637572 (diff) | |
parent | 5a36e2f20bb5dd9cb04a1e8010280995c6305a39 (diff) | |
download | dotty-eec8191fc067358f88bec56d7dbda36e1fcfc131.tar.gz dotty-eec8191fc067358f88bec56d7dbda36e1fcfc131.tar.bz2 dotty-eec8191fc067358f88bec56d7dbda36e1fcfc131.zip |
Merge pull request #758 from dotty-staging/fix-liftedTry-capturedVars-interaction
Fix lift try and captured vars interaction
Diffstat (limited to 'tests/run')
-rw-r--r-- | tests/run/liftedTry.scala | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/run/liftedTry.scala b/tests/run/liftedTry.scala index 2e4c25c2b..5ff4add6d 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 => val x = 4; s = x; 5 } + s + } +} |