diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/MethodSignatureMapper.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/MethodSignatureMapper.kt index 2ad086ca374..8cc4cc0a3fa 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/MethodSignatureMapper.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/MethodSignatureMapper.kt @@ -201,7 +201,7 @@ class MethodSignatureMapper(private val context: JvmBackendContext) { mapSignature(function, false) private fun mapSignature(function: IrFunction, skipGenericSignature: Boolean, skipSpecial: Boolean = false): JvmMethodGenericSignature { - if (function is IrLazyFunctionBase && function.initialSignatureFunction != null) { + if (function is IrLazyFunctionBase && !function.isFakeOverride && function.initialSignatureFunction != null) { // Overrides of special builtin in Kotlin classes always have special signature if ((function as? IrSimpleFunction)?.getDifferentNameForJvmBuiltinFunction() == null || (function.parent as? IrClass)?.origin == IrDeclarationOrigin.IR_EXTERNAL_JAVA_DECLARATION_STUB diff --git a/compiler/testData/compileKotlinAgainstKotlin/specialBridgesInDependencies.kt b/compiler/testData/compileKotlinAgainstKotlin/specialBridgesInDependencies.kt new file mode 100644 index 00000000000..a3be6bc6b0e --- /dev/null +++ b/compiler/testData/compileKotlinAgainstKotlin/specialBridgesInDependencies.kt @@ -0,0 +1,18 @@ +// WITH_RUNTIME +// FILE: A.kt + +package a + +open class A : ArrayList() + +// FILE: B.kt + +import a.A + +class B : A() + +fun box(): String { + val b = B() + b += "OK" + return b.single() +} diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java index c878917801c..9f9044306f1 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java @@ -353,6 +353,11 @@ public class CompileKotlinAgainstKotlinTestGenerated extends AbstractCompileKotl runTest("compiler/testData/compileKotlinAgainstKotlin/simpleValAnonymousObject.kt"); } + @TestMetadata("specialBridgesInDependencies.kt") + public void testSpecialBridgesInDependencies() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/specialBridgesInDependencies.kt"); + } + @TestMetadata("starImportEnum.kt") public void testStarImportEnum() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/starImportEnum.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstKotlinTestGenerated.java index f16ce86ba6b..91d7c44bfdf 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstKotlinTestGenerated.java @@ -348,6 +348,11 @@ public class IrCompileKotlinAgainstKotlinTestGenerated extends AbstractIrCompile runTest("compiler/testData/compileKotlinAgainstKotlin/simpleValAnonymousObject.kt"); } + @TestMetadata("specialBridgesInDependencies.kt") + public void testSpecialBridgesInDependencies() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/specialBridgesInDependencies.kt"); + } + @TestMetadata("starImportEnum.kt") public void testStarImportEnum() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/starImportEnum.kt");