Files
kotlin-fork/compiler/testData/codegen/boxInline/smap/anonymous/lambda.kt
T
Alexander Udalov 3f034e8b67 Enable lightweight lambdas (aka invokedynamic) since 2.0
#KT-45375 Fixed
 #KT-58173 Open
2024-02-08 19:46:18 +00:00

31 lines
360 B
Kotlin
Vendored

// NO_CHECK_LAMBDA_INLINING
// IGNORE_INLINER_K2: IR
// FILE: 1.kt
package builders
inline fun call(crossinline init: () -> Unit) {
val lambda = {
init()
}; lambda()
}
// FILE: 2.kt
import builders.*
fun test(): String {
var res = "Fail"
call {
res = "OK"
}
return res
}
fun box(): String {
return test()
}