Support default arguments and varargs for callable references

#KT-8834
 #KT-19869
 #KT-25514
This commit is contained in:
Alexander Udalov
2017-08-23 16:42:23 +03:00
parent f71909ee73
commit 9babd90999
17 changed files with 523 additions and 13 deletions
@@ -0,0 +1,13 @@
// !LANGUAGE: +NewInference
// IGNORE_BACKEND: JS, JS_IR, JVM_IR
fun foo(x: Int, vararg y: String = arrayOf("Aaa")): String =
if (y[0].length == x) "OK" else "Fail"
fun use0(f: (Int) -> String): String = f(3)
fun use1(f: (Int, String) -> String): String = f(5, "Bbbbb")
fun box(): String {
if (use0(::foo) != "OK") return "Fail"
return use1(::foo)
}