[IR] Fix remapping of arguments in LocalDeclarationsLowering.

It only remapped arguments for IrGetValue and not for IrSetValue.
This is hitting Compose which has non-standard default argument
handling.
This commit is contained in:
Mads Ager
2020-11-30 13:16:23 +01:00
committed by Alexander Udalov
parent 167e60b9fb
commit a7efa5c98b
8 changed files with 94 additions and 4 deletions
@@ -305,6 +305,23 @@ class LocalDeclarationsLowering(
return expression
}
override fun visitSetValue(expression: IrSetValue): IrExpression {
expression.transformChildrenVoid(this)
val declaration = expression.symbol.owner
oldParameterToNew[declaration]?.let {
return IrSetValueImpl(
expression.startOffset,
expression.endOffset,
it.type,
it.symbol,
expression.value,
expression.origin
)
}
return expression
}
override fun visitCall(expression: IrCall): IrExpression {
expression.transformChildrenVoid(this)
@@ -346,10 +346,6 @@ class ExpressionCodegen(
}
private fun writeValueParameterInLocalVariableTable(param: IrValueParameter, startLabel: Label, endLabel: Label, isReceiver: Boolean) {
// TODO: old code has a special treatment for destructuring lambda parameters.
// There is no (easy) way to reproduce it with IR structures.
// Does not show up in tests, but might come to bite us at some point.
// If the parameter is an extension receiver parameter or a captured extension receiver from enclosing,
// then generate name accordingly.
val name = if (param.origin == BOUND_RECEIVER_PARAMETER || isReceiver) {