diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/SyntheticAccessorLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/SyntheticAccessorLowering.kt index 6fef7d8b85d..6b5d7f027c1 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/SyntheticAccessorLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/SyntheticAccessorLowering.kt @@ -70,7 +70,13 @@ internal class SyntheticAccessorLowering(val context: JvmBackendContext) : IrEle private data class FieldKey(val fieldSymbol: IrFieldSymbol, val parent: IrDeclarationParent, val superQualifierSymbol: IrClassSymbol?) - private val functionMap = mutableMapOf, IrFunctionSymbol>() + private data class FunctionKey( + val functionSymbol: IrFunctionSymbol, + val parent: IrDeclarationParent, + val superQualifierSymbol: IrClassSymbol? + ) + + private val functionMap = mutableMapOf() private val getterMap = mutableMapOf() private val setterMap = mutableMapOf() @@ -157,7 +163,7 @@ internal class SyntheticAccessorLowering(val context: JvmBackendContext) : IrEle // For the call to super.g in function i, the accessor to A.g must be produced in C. Therefore, we // cannot use the function symbol (A.g in the example) by itself as the key since there should be // one accessor per dispatch receiver (i.e., parent of the accessor). - return functionMap.getOrPut(symbol to parent) { + return functionMap.getOrPut(FunctionKey(symbol, parent, superQualifierSymbol)) { when (symbol) { is IrConstructorSymbol -> symbol.owner.makeConstructorAccessor() diff --git a/compiler/testData/codegen/box/syntheticAccessors/accessorForProtectedInvokeVirtual.kt b/compiler/testData/codegen/box/syntheticAccessors/accessorForProtectedInvokeVirtual.kt index 750d4b31edd..f68dda4d4b1 100644 --- a/compiler/testData/codegen/box/syntheticAccessors/accessorForProtectedInvokeVirtual.kt +++ b/compiler/testData/codegen/box/syntheticAccessors/accessorForProtectedInvokeVirtual.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // FILE: 1.kt