DeprecatedSymbolUsageFix: keeping named arguments
This commit is contained in:
@@ -52,10 +52,14 @@ public object OptionalParametersHelper {
|
||||
|
||||
val arguments = resolvedCall.getCall().getValueArguments()
|
||||
val argumentsToDrop = ArrayList<ValueArgument>()
|
||||
|
||||
//TODO: can drop arguments leaving last functional literal one (outside of parenthesis)
|
||||
|
||||
for (argument in arguments.reverse()) {
|
||||
if (!canDrop(argument)) break // TODO: not correct because of named arguments
|
||||
if (!argument.matchesDefault(resolvedCall, parameterToDefaultValue)) break // TODO: not correct because of named arguments
|
||||
if (!canDrop(argument) || !argument.matchesDefault(resolvedCall, parameterToDefaultValue)) {
|
||||
if (!argument.isNamed()) break else continue // for a named argument we can try to drop arguments before it as well
|
||||
}
|
||||
|
||||
argumentsToDrop.add(argument)
|
||||
}
|
||||
return argumentsToDrop
|
||||
|
||||
Reference in New Issue
Block a user