04e57f712e
Relates to KT-8834, we continue reducing differences between old and new inference. Note that as for `SamConversionPerArgument`, this feature is enabled in the compiler and not in the IDE to avoid breaking code for those users that already enabled new inference in the compiler
16 lines
576 B
Kotlin
Vendored
16 lines
576 B
Kotlin
Vendored
// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType
|
|
// IGNORE_BACKEND: JS
|
|
|
|
fun foo(x: Int, s: Int, vararg y: CharSequence = arrayOf("Aaa")): String =
|
|
if (y.size == s && y[0].length == x) "OK" else "Fail"
|
|
|
|
fun use0(f: (Int, Int) -> String): String = f(3, 1)
|
|
fun use1(f: (Int, Int, String) -> String): String = f(5, 1, "Bbbbb")
|
|
fun use2(f: (Int, Int, String, String) -> String): String = f(5, 2, "Bbbbb", "Ccccc")
|
|
|
|
fun box(): String {
|
|
if (use0(::foo) != "OK") return "Fail0"
|
|
if (use1(::foo) != "OK") return "Fail1"
|
|
return use2(::foo)
|
|
}
|