mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-11 08:31:30 +00:00
19 lines
248 B
Kotlin
Vendored
19 lines
248 B
Kotlin
Vendored
|
|
fun bar(b: ()-> Unit) { b() }
|
|
|
|
class C() {
|
|
val p: Int = run {
|
|
var v = 10
|
|
bar() {
|
|
v = 20
|
|
}
|
|
v + 1
|
|
}
|
|
}
|
|
|
|
fun box(): String {
|
|
val c = C()
|
|
if (c.p != 21) return "fail ${c.p}"
|
|
return "OK"
|
|
}
|