[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:
Nikolay Lunyak
2022-02-10 16:54:06 +03:00
committed by teamcity
parent 994e2970c7
commit 4038c06b1e
@@ -159,19 +159,25 @@ private class FirCallArgumentsProcessor(
}
private fun processNonLambdaArgument(argument: FirExpression, isLastArgument: Boolean) {
// process position argument
if (argument !is FirNamedArgumentExpression) {
if (processPositionArgument(argument, isLastArgument)) {
state = State.VARARG_POSITION
when {
// process position argument
argument !is FirNamedArgumentExpression -> {
if (processPositionArgument(argument, isLastArgument)) {
state = State.VARARG_POSITION
}
}
}
// process named argument
else {
if (state == State.VARARG_POSITION) {
completeVarargPositionArguments()
// process named argument
function.origin == FirDeclarationOrigin.DynamicScope -> {
if (processPositionArgument(argument.expression, isLastArgument)) {
state = State.VARARG_POSITION
}
}
else -> {
if (state == State.VARARG_POSITION) {
completeVarargPositionArguments()
}
processNamedArgument(argument)
}
processNamedArgument(argument)
}
}