mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
19 lines
370 B
Kotlin
Vendored
19 lines
370 B
Kotlin
Vendored
// NO_CHECK_LAMBDA_INLINING
|
|
|
|
// FILE: 1.kt
|
|
inline fun test(noinline foo: () -> String, noinline bar: () -> String): String {
|
|
var vfoo = foo
|
|
var vbar = bar
|
|
var vres = foo
|
|
for (i in 1 .. 4) {
|
|
vres = vbar
|
|
vbar = vfoo
|
|
vfoo = vres
|
|
}
|
|
return vres()
|
|
}
|
|
|
|
|
|
// FILE: 2.kt
|
|
fun box(): String =
|
|
test({ "OK" }, { "wrong lambda" }) |