[FIR JS] Treat named arguments as positional for dynamics
Note: 174/1627 failing FirJsTest tests remaining - 170 are multi-module tests - 4 tests have to do with IR
This commit is contained in:
+9
-3
@@ -159,21 +159,27 @@ private class FirCallArgumentsProcessor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun processNonLambdaArgument(argument: FirExpression, isLastArgument: Boolean) {
|
private fun processNonLambdaArgument(argument: FirExpression, isLastArgument: Boolean) {
|
||||||
|
when {
|
||||||
// process position argument
|
// process position argument
|
||||||
if (argument !is FirNamedArgumentExpression) {
|
argument !is FirNamedArgumentExpression -> {
|
||||||
if (processPositionArgument(argument, isLastArgument)) {
|
if (processPositionArgument(argument, isLastArgument)) {
|
||||||
state = State.VARARG_POSITION
|
state = State.VARARG_POSITION
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// process named argument
|
// process named argument
|
||||||
else {
|
function.origin == FirDeclarationOrigin.DynamicScope -> {
|
||||||
|
if (processPositionArgument(argument.expression, isLastArgument)) {
|
||||||
|
state = State.VARARG_POSITION
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else -> {
|
||||||
if (state == State.VARARG_POSITION) {
|
if (state == State.VARARG_POSITION) {
|
||||||
completeVarargPositionArguments()
|
completeVarargPositionArguments()
|
||||||
}
|
}
|
||||||
|
|
||||||
processNamedArgument(argument)
|
processNamedArgument(argument)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// return true, if it was mapped to vararg parameter
|
// return true, if it was mapped to vararg parameter
|
||||||
private fun processPositionArgument(argument: FirExpression, isLastArgument: Boolean): Boolean {
|
private fun processPositionArgument(argument: FirExpression, isLastArgument: Boolean): Boolean {
|
||||||
|
|||||||
Reference in New Issue
Block a user