Closures in scripts have outer expression

#KT-22029 Fixed Target versions 1.2.30
This commit is contained in:
Dmitry Petrov
2018-01-09 12:38:25 +03:00
parent d25ebadf53
commit 5ffd6a737e
3 changed files with 19 additions and 1 deletions
+9
View File
@@ -0,0 +1,9 @@
data class Pair(val first: Int, val second: Int)
inline fun <T> run(fn: () -> T) = fn()
val fstSec = 42
val (fst, snd) = run { Pair(fstSec, fstSec) }
// expected: fst: 42