mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
15 lines
230 B
Kotlin
Vendored
15 lines
230 B
Kotlin
Vendored
// WITH_RUNTIME
|
|
|
|
import kotlin.test.assertEquals
|
|
|
|
inline fun <R> foo(x : R, block : (R) -> R) : R {
|
|
return block(x)
|
|
}
|
|
|
|
fun box() : String {
|
|
val result = foo(1) { x -> x + 1 }
|
|
assertEquals(2, result)
|
|
|
|
return "OK"
|
|
}
|