mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
13 lines
201 B
Kotlin
13 lines
201 B
Kotlin
|
|
inline fun calc<T, R>(value : T, fn: (T)->R) : R = fn(value)
|
|
inline fun identity<T>(value : T) : T = calc(value) {
|
|
if (1 == 1) return it
|
|
it
|
|
}
|
|
|
|
fun foo() {
|
|
val x = identity(1)
|
|
}
|
|
|
|
// 1 GOTO
|