8 lines
145 B
Kotlin
Vendored
8 lines
145 B
Kotlin
Vendored
fun <T, R> apply(x: T, f: (T) -> R): R = f(x)
|
|
|
|
fun foo(i: Int) {}
|
|
fun foo(s: String) {}
|
|
|
|
val x1 = apply(1, ::foo)
|
|
val x2 = apply("hello", ::foo)
|