Files
kotlin/compiler/testData/codegen/box/functions/localFunctions/definedWithinLambdaInnerUsage2.kt
2019-11-19 11:00:09 +03:00

19 lines
390 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
import kotlin.test.assertEquals
inline fun foo(x: String, block: (String) -> String) = block(x)
fun noInlineFoo(x: String, block: (String) -> String) = block(x)
fun box(): String {
val res = foo("abc") {
fun bar(y: String) = y + "cde"
noInlineFoo(it) { bar(it) }
}
assertEquals("abccde", res)
return "OK"
}