Files
kotlin-fork/compiler/testData/codegen/boxInline/smap/anonymous/severalMappingsForDefaultFile.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

35 lines
526 B
Kotlin
Vendored

// IGNORE_INLINER_K2: IR
// FILE: 1.kt
// NO_SMAP_DUMP
package test
inline fun annotatedWith2(crossinline predicate: () -> Boolean)
{ val lambda = { any { predicate() } }; lambda() }
inline fun annotatedWith(crossinline predicate: () -> Boolean) =
annotatedWith2 { predicate() }
inline fun any(s: () -> Boolean) {
s()
}
// FILE: 2.kt
import test.*
fun box(): String {
var result = "fail"
annotatedWith { result = "OK"; true }
return result
}
inline fun test(z: () -> Unit) {
z()
}