mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
12 lines
247 B
Kotlin
Vendored
12 lines
247 B
Kotlin
Vendored
data class A<T, F>(val x: T, val y: F)
|
|
|
|
fun <X, Y> foo(a: A<X, Y>, block: (A<X, Y>) -> String) = block(a)
|
|
|
|
fun box(): String {
|
|
val x = foo(A("OK", 1)) { (x, y) -> x + (y.toString()) }
|
|
|
|
if (x != "OK1") return "fail1: $x"
|
|
|
|
return "OK"
|
|
}
|