mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-11 00:21:29 +00:00
14 lines
243 B
Kotlin
14 lines
243 B
Kotlin
import kotlin.test.assertEquals
|
|
|
|
inline fun foo(x: String, block: (String) -> String) = block(x)
|
|
|
|
fun box(): String {
|
|
fun bar(y: String) = y + "cde"
|
|
|
|
val res = foo("abc") { bar(it) }
|
|
|
|
assertEquals("abccde", res)
|
|
|
|
return "OK"
|
|
}
|