Support default arguments and varargs for callable references
#KT-8834 #KT-19869 #KT-25514
This commit is contained in:
+10
@@ -0,0 +1,10 @@
|
||||
// KT-25514 Support usage of function reference with vararg where function of array is expected in new inference
|
||||
// IGNORE_BACKEND: JVM_IR, 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)
|
||||
}
|
||||
Reference in New Issue
Block a user