diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/mangle/descriptor/DescriptorMangleComputer.kt b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/mangle/descriptor/DescriptorMangleComputer.kt index bebee5079ff..900e60b0c3e 100644 --- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/mangle/descriptor/DescriptorMangleComputer.kt +++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/mangle/descriptor/DescriptorMangleComputer.kt @@ -206,7 +206,7 @@ abstract class DescriptorMangleComputer(protected val builder: StringBuilder, pr val lower = type.lowerBound val lowerDescriptor = lower.constructor.declarationDescriptor as? ClassDescriptor ?: error("No class descriptor for lower type $lower of $type") - val intermediate = if (lowerDescriptor == upperDescriptor) { + val intermediate = if (lowerDescriptor == upperDescriptor && type !is RawType) { lower.replace(newArguments = upper.arguments) } else lower val mixed = intermediate.makeNullableAsSpecified(upper.isMarkedNullable) diff --git a/compiler/testData/codegen/boxInline/signatureMangling/rawType.kt b/compiler/testData/codegen/boxInline/signatureMangling/rawType.kt index d7cc4227ede..dd2580d2ab4 100644 --- a/compiler/testData/codegen/boxInline/signatureMangling/rawType.kt +++ b/compiler/testData/codegen/boxInline/signatureMangling/rawType.kt @@ -1,16 +1,22 @@ // TARGET_BACKEND: JVM_IR // WITH_RUNTIME -// FILE: UseRawType.java -import java.util.List; +// FILE: C.java +public class C { + T val; -public class UseRawType { - static public List useList(List arg) { - return arg; - } + public C(T val) { this.val = val; } + + public T getVal() { return val; } } -// FILE: use.kt -inline fun callRawType() = UseRawType.useList(listOf("OK")) as List +// FILE: UseRaw.java +public class UseRaw { + static public C cId(C c) { return c; } + static public void cId() {} // DescriptorByIdSignatureFinder only checks ID if there are multiple functions with a given name. +} +// FILE: inlineCall.kt +inline fun inlineCallRaw(s: String): String = + (UseRaw.cId(C(s)) as C).getVal() // FILE: box.kt -fun box() = callRawType()[0] \ No newline at end of file +fun box() = inlineCallRaw("OK") \ No newline at end of file