JVM IR: More precise check for calls to the implementation method in a default stub

This commit is contained in:
Steven Schäfer
2020-09-22 16:46:26 +02:00
committed by max-kammerer
parent 648bc9b1c4
commit 3a7cc93c4e
13 changed files with 74 additions and 3 deletions
@@ -178,12 +178,14 @@ open class DefaultArgumentStubGenerator(
return createTmpVariable(value, nameHint = parameter.name.asString())
}
protected open fun getOriginForCallToImplementation(): IrStatementOrigin? = null
private fun IrBlockBodyBuilder.dispatchToImplementation(
irFunction: IrSimpleFunction,
newIrFunction: IrFunction,
params: MutableList<IrValueDeclaration>
): IrExpression {
val dispatchCall = irCall(irFunction.symbol).apply {
val dispatchCall = irCall(irFunction, origin = getOriginForCallToImplementation()).apply {
passTypeArgumentsFrom(newIrFunction)
dispatchReceiver = newIrFunction.dispatchReceiverParameter?.let { irGet(it) }
extensionReceiver = newIrFunction.extensionReceiverParameter?.let { irGet(it) }