e95de0a778
ProhibitAssigningSingleElementsToVarargsInNamedForm is enabled from 1.3 so there is no need to make FIR accepting single element passed through named arguments. In addition, we may want to report only ASSIGNING_SINGLE_ELEMENT_TO_VARARG_IN_NAMED_FORM_FUNCTION and not arg type mismatch. But FE1.0 is reporting both so I am following it. If we want to remove the redundant report, we will probably want to remove FirNamedVarargChecker and report during resolution as a cone diagnostic.
14 lines
425 B
Kotlin
Vendored
14 lines
425 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 = <!NONE_APPLICABLE!>overloadedFun<!>("", args = "")
|
|
val test1c: X2 = overloadedFun("", "", "", flag = true)
|
|
|