Files
kotlin/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambda.kt
2015-02-27 14:16:20 +03:00

16 lines
257 B
Kotlin

fun test(bal: Array<Int>) {
var bar = 4
val a = { bar += 4 }
a : () -> Unit
val b = { bar = 4 }
b : () -> Unit
val c = { bal[2] = 3 }
c : () -> Unit
val d = run { bar += 4 }
d : Unit
}
fun <T> run(f: () -> T): T = f()