aboutsummaryrefslogtreecommitdiff
path: root/tests/run/liftedTry.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-08-15 11:16:35 -0700
committerMartin Odersky <odersky@gmail.com>2015-08-15 13:55:31 -0700
commit4ff06368cda585e3a2d04af084a8fe09662e55f0 (patch)
treecf841e0767677fa922c5e0ca3cebea6303e6c9f9 /tests/run/liftedTry.scala
parentedaa193aac1d7880a81cd6a836fe3d7c3d652d45 (diff)
downloaddotty-4ff06368cda585e3a2d04af084a8fe09662e55f0.tar.gz
dotty-4ff06368cda585e3a2d04af084a8fe09662e55f0.tar.bz2
dotty-4ff06368cda585e3a2d04af084a8fe09662e55f0.zip
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.
Diffstat (limited to 'tests/run/liftedTry.scala')
-rw-r--r--tests/run/liftedTry.scala2
1 files changed, 1 insertions, 1 deletions
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
}
}