Files
kotlin-fork/compiler/testData/codegen/boxInline/simple/rootConstructor.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

27 lines
356 B
Kotlin
Vendored

// NO_CHECK_LAMBDA_INLINING
// IGNORE_INLINER_K2: IR
// FILE: 1.kt
package test
inline fun <R> doWork(crossinline job: ()-> R) : R {
return notInline({job()})
}
fun <R> notInline(job: ()-> R) : R {
return job()
}
// FILE: 2.kt
import test.*
val s = doWork({11})
fun box(): String {
if (s != 11) return "test1: ${s}"
return "OK"
}