b2fa104081
Previously, when a candidate was found with an applicability that is better than the current best applicability, all previous candidates were thrown away. Now we keep them, unless the new applicability is successful. If no successful candidates are found, we fully resolve all the unsuccessful ones and select the ones with the least bad applicability. This improves diagnostics for unresolved calls. #KT-57844 Fixed
14 lines
497 B
Kotlin
Vendored
14 lines
497 B
Kotlin
Vendored
// !LANGUAGE: +ProhibitAssigningSingleElementsToVarargsInNamedForm
|
|
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
|
|
|
object X1
|
|
object X2
|
|
|
|
fun overloadedFun(arg: String, vararg args: String) = X1
|
|
fun overloadedFun(arg: String, vararg args: String, flag: Boolean = true) = X2
|
|
|
|
val test1a: X1 = overloadedFun("", "")
|
|
val test1b: X1 = overloadedFun("", args = <!ARGUMENT_TYPE_MISMATCH, ASSIGNING_SINGLE_ELEMENT_TO_VARARG_IN_NAMED_FORM_FUNCTION_ERROR!>""<!>)
|
|
val test1c: X2 = overloadedFun("", "", "", flag = true)
|
|
|