mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
11 lines
321 B
Kotlin
Vendored
11 lines
321 B
Kotlin
Vendored
// KT-25514 Support usage of function reference with vararg where function of array is expected in new inference
|
|
// IGNORE_BACKEND: JS_IR
|
|
|
|
fun foo(x: Int, vararg y: String): String = y[0]
|
|
|
|
fun useArray(f: (Int, Array<String>) -> String): String = f(1, Array(1) { "OK" })
|
|
|
|
fun box(): String {
|
|
return useArray(::foo)
|
|
}
|