Files
kotlin-fork/js/js.translator/testFiles/expression/misc/cases/localVarAsFunction.kt
T
Pavel V. Talanov b883bf6ef5 Adopt more tests for functions from codegen tests.
Create test for KT-2565.
2012-07-31 18:51:13 +04:00

17 lines
243 B
Kotlin

package foo
var c = 2
fun loop(var times : Int) {
while(times > 0) {
val u : (value : Int) -> Unit = {
c++
}
u(times--)
}
}
fun box() : Any? {
loop(5)
return if (c == 7) return "OK" else c
}