Do not check argumentMapping.isError()
Argument matching status can be considered an "error" in resolve, even though it is not a compilation error and doesn't prevent code from being generated. Actually, we should only check if the argument matching status is ArgumentMatch. #KT-18294 Fixed
This commit is contained in:
@@ -48,10 +48,8 @@ fun KtElement.deparenthesize(): KtElement =
|
||||
fun ResolvedCall<*>.isValueArgumentReorderingRequired(): Boolean {
|
||||
var lastValueParameterIndex = -1
|
||||
for (valueArgument in call.valueArguments) {
|
||||
val argumentMapping = getArgumentMapping(valueArgument)
|
||||
if (argumentMapping !is ArgumentMatch || argumentMapping.isError()) {
|
||||
throw Exception("Value argument in function call is mapped with error")
|
||||
}
|
||||
val argumentMapping = getArgumentMapping(valueArgument) as? ArgumentMatch ?:
|
||||
throw Exception("Value argument in function call is mapped with error")
|
||||
val argumentIndex = argumentMapping.valueParameter.index
|
||||
if (argumentIndex < lastValueParameterIndex) {
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user