Files
kotlin-fork/compiler/testData/codegen/box/functions/localFunctions/definedWithinLambda.kt
T
2016-11-16 19:50:10 +03:00

17 lines
275 B
Kotlin
Vendored

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