JVM IR: Fix special bridge generation with external Kotlin dependencies
This commit is contained in:
committed by
Alexander Udalov
parent
730e07c52a
commit
6100166185
+1
-1
@@ -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
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
// WITH_RUNTIME
|
||||
// FILE: A.kt
|
||||
|
||||
package a
|
||||
|
||||
open class A : ArrayList<String>()
|
||||
|
||||
// FILE: B.kt
|
||||
|
||||
import a.A
|
||||
|
||||
class B : A()
|
||||
|
||||
fun box(): String {
|
||||
val b = B()
|
||||
b += "OK"
|
||||
return b.single()
|
||||
}
|
||||
+5
@@ -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");
|
||||
|
||||
Generated
+5
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user