[JS IR] Set proper statement origin for bound receiver save
This commit is contained in:
committed by
TeamCityServer
parent
abd2507107
commit
a1b223e33d
+4
-1
@@ -10,6 +10,7 @@ import org.jetbrains.kotlin.backend.common.CommonBackendContext
|
|||||||
import org.jetbrains.kotlin.backend.common.ir.copyTo
|
import org.jetbrains.kotlin.backend.common.ir.copyTo
|
||||||
import org.jetbrains.kotlin.backend.common.ir.createImplicitParameterDeclarationWithWrappedDescriptor
|
import org.jetbrains.kotlin.backend.common.ir.createImplicitParameterDeclarationWithWrappedDescriptor
|
||||||
import org.jetbrains.kotlin.backend.common.ir.moveBodyTo
|
import org.jetbrains.kotlin.backend.common.ir.moveBodyTo
|
||||||
|
import org.jetbrains.kotlin.backend.common.lower.LoweredStatementOrigins
|
||||||
import org.jetbrains.kotlin.ir.backend.js.JsStatementOrigins
|
import org.jetbrains.kotlin.ir.backend.js.JsStatementOrigins
|
||||||
import org.jetbrains.kotlin.backend.common.lower.createIrBuilder
|
import org.jetbrains.kotlin.backend.common.lower.createIrBuilder
|
||||||
import org.jetbrains.kotlin.backend.common.runOnFilePostfix
|
import org.jetbrains.kotlin.backend.common.runOnFilePostfix
|
||||||
@@ -186,7 +187,9 @@ class CallableReferenceLowering(private val context: CommonBackendContext) : Bod
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
boundReceiverParameter?.let {
|
boundReceiverParameter?.let {
|
||||||
+irSetField(irGet(clazz.thisReceiver!!), boundReceiverField!!, irGet(it))
|
+irSetField(irGet(clazz.thisReceiver!!), boundReceiverField!!, irGet(it),
|
||||||
|
LoweredStatementOrigins.STATEMENT_ORIGIN_INITIALIZER_OF_FIELD_FOR_CAPTURED_VALUE
|
||||||
|
)
|
||||||
}
|
}
|
||||||
+IrInstanceInitializerCallImpl(startOffset, endOffset, clazz.symbol, context.irBuiltIns.unitType)
|
+IrInstanceInitializerCallImpl(startOffset, endOffset, clazz.symbol, context.irBuiltIns.unitType)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -141,8 +141,8 @@ fun IrBuilderWithScope.irSet(variable: IrValueDeclaration, value: IrExpression,
|
|||||||
fun IrBuilderWithScope.irGetField(receiver: IrExpression?, field: IrField) =
|
fun IrBuilderWithScope.irGetField(receiver: IrExpression?, field: IrField) =
|
||||||
IrGetFieldImpl(startOffset, endOffset, field.symbol, field.type, receiver)
|
IrGetFieldImpl(startOffset, endOffset, field.symbol, field.type, receiver)
|
||||||
|
|
||||||
fun IrBuilderWithScope.irSetField(receiver: IrExpression?, field: IrField, value: IrExpression) =
|
fun IrBuilderWithScope.irSetField(receiver: IrExpression?, field: IrField, value: IrExpression, origin: IrStatementOrigin? = null) =
|
||||||
IrSetFieldImpl(startOffset, endOffset, field.symbol, receiver, value, context.irBuiltIns.unitType)
|
IrSetFieldImpl(startOffset, endOffset, field.symbol, receiver, value, context.irBuiltIns.unitType, origin = origin)
|
||||||
|
|
||||||
fun IrBuilderWithScope.irGetObjectValue(type: IrType, classSymbol: IrClassSymbol) =
|
fun IrBuilderWithScope.irGetObjectValue(type: IrType, classSymbol: IrClassSymbol) =
|
||||||
IrGetObjectValueImpl(startOffset, endOffset, type, classSymbol)
|
IrGetObjectValueImpl(startOffset, endOffset, type, classSymbol)
|
||||||
|
|||||||
Reference in New Issue
Block a user