JVM IR: Take superQualifierSymbols into account when lowering inline classes

This commit is contained in:
Steven Schäfer
2020-05-05 17:12:33 +02:00
committed by Alexander Udalov
parent 52abc2ae1a
commit 821aca984b
9 changed files with 49 additions and 2 deletions
@@ -255,7 +255,7 @@ private class JvmInlineClassLowering(private val context: JvmBackendContext) : F
val replacement = context.inlineClassReplacements.getReplacementFunction(function)
?: return super.visitFunctionAccess(expression)
return context.createIrBuilder(currentScope!!.scope.scopeOwnerSymbol, expression.startOffset, expression.endOffset)
.irCall(replacement).apply {
.irCall(replacement, expression.origin, expression.safeAs<IrCall>()?.superQualifierSymbol).apply {
buildReplacement(function, expression, replacement)
}
}
@@ -268,7 +268,7 @@ fun IrBuilderWithScope.irCall(callee: IrFunctionSymbol, descriptor: FunctionDesc
fun IrBuilderWithScope.irCall(callee: IrFunction): IrFunctionAccessExpression =
irCall(callee.symbol)
fun IrBuilderWithScope.irCall(callee: IrFunction, origin: IrStatementOrigin, superQualifierSymbol: IrClassSymbol? = null): IrCall =
fun IrBuilderWithScope.irCall(callee: IrFunction, origin: IrStatementOrigin? = null, superQualifierSymbol: IrClassSymbol? = null): IrCall =
IrCallImpl(
startOffset, endOffset, callee.returnType,
callee.symbol as IrSimpleFunctionSymbol,