diff options
author | Martin Odersky <odersky@gmail.com> | 2016-09-13 12:24:42 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-10-02 16:12:28 +0200 |
commit | 65551d19b5d928f231426c016e561051d68d9c97 (patch) | |
tree | 2715d259ee41f6cf3ad6e9a8271d2626cfe3e51b /tests | |
parent | 4de907a313e9b85058cd9611116a1cbcf2bd3a4f (diff) | |
download | dotty-65551d19b5d928f231426c016e561051d68d9c97.tar.gz dotty-65551d19b5d928f231426c016e561051d68d9c97.tar.bz2 dotty-65551d19b5d928f231426c016e561051d68d9c97.zip |
Don't drop inline closure bindings that are referred in the body
The body might still refer to an inline closure argument without
fully applying it. In that case the binding may not be dropped.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/run/inlinedAssign.scala | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/run/inlinedAssign.scala b/tests/run/inlinedAssign.scala index f405f5073..5b73a6f0c 100644 --- a/tests/run/inlinedAssign.scala +++ b/tests/run/inlinedAssign.scala @@ -6,6 +6,8 @@ object Test { y_=(t) } + inline def f(x: Int => Unit) = x + def main(args: Array[String]) = { var x = 1 var y = 2 @@ -13,5 +15,7 @@ object Test { inline def setY(z: Int) = y = z swap(x, setX, y, setY) assert(x == 2 && y == 1) + + val z = f(setX) // tests case where inline arg is not applied } } |