FIR checker: report type mismatch for named vararg arguement
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.
This commit is contained in:
committed by
teamcityserver
parent
3708290ca3
commit
e95de0a778
@@ -12,7 +12,7 @@ fun test() {
|
||||
|
||||
bar(1, z = true, y = *arrayOf("my", "yours"))
|
||||
|
||||
bar(0, z = false, y = <!ASSIGNING_SINGLE_ELEMENT_TO_VARARG_IN_NAMED_FORM_FUNCTION_ERROR!>""<!>, <!ARGUMENT_PASSED_TWICE!>y<!> = "other")
|
||||
bar(0, z = false, y = <!ARGUMENT_TYPE_MISMATCH, ASSIGNING_SINGLE_ELEMENT_TO_VARARG_IN_NAMED_FORM_FUNCTION_ERROR!>""<!>, <!ARGUMENT_PASSED_TWICE!>y<!> = "other")
|
||||
bar(0, "", true<!NO_VALUE_FOR_PARAMETER!>)<!>
|
||||
bar(0, z = false, y = <!ASSIGNING_SINGLE_ELEMENT_TO_VARARG_IN_NAMED_FORM_FUNCTION_ERROR!>""<!>, <!ARGUMENT_PASSED_TWICE!>y<!> = "other", <!ARGUMENT_PASSED_TWICE!>y<!> = "yet other")
|
||||
bar(0, z = false, y = <!ARGUMENT_TYPE_MISMATCH, ASSIGNING_SINGLE_ELEMENT_TO_VARARG_IN_NAMED_FORM_FUNCTION_ERROR!>""<!>, <!ARGUMENT_PASSED_TWICE!>y<!> = "other", <!ARGUMENT_PASSED_TWICE!>y<!> = "yet other")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user