7a22ad099a
Adapted from https://github.com/develar/kotlin/commit/a9e0a42fb1347fa8e21c86b5a073ef8a7c873da0.
17 lines
220 B
Kotlin
17 lines
220 B
Kotlin
package foo
|
|
|
|
var b = 0
|
|
|
|
fun loop(var times: Int) {
|
|
while (times > 0) {
|
|
val u = {(value: Int) ->
|
|
b = b + 1
|
|
}
|
|
u(times--)
|
|
}
|
|
}
|
|
|
|
fun box(): Boolean {
|
|
loop(5)
|
|
return b == 5
|
|
} |