From 4ff06368cda585e3a2d04af084a8fe09662e55f0 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sat, 15 Aug 2015 11:16:35 -0700 Subject: Add a local val to lifted try to make sure owners are still legal. Checks the hypothesis that lifting a try may safely move expressions into a ValDef owned by a new temp var. --- tests/run/liftedTry.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/run/liftedTry.scala b/tests/run/liftedTry.scala index 0d956fc1f..5ff4add6d 100644 --- a/tests/run/liftedTry.scala +++ b/tests/run/liftedTry.scala @@ -25,7 +25,7 @@ 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 = try {fun(s = _); 3} catch{ case ex: Throwable => val x = 4; s = x; 5 } s } } -- cgit v1.2.3