mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 08:31:29 +00:00
13 lines
213 B
Kotlin
13 lines
213 B
Kotlin
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"
|
|
}
|