JVM_IR: special case for raw types in DescriptorMangleComputer
This commit is contained in:
committed by
teamcityserver
parent
247cbffbac
commit
64e2911b58
+1
-1
@@ -206,7 +206,7 @@ abstract class DescriptorMangleComputer(protected val builder: StringBuilder, pr
|
|||||||
val lower = type.lowerBound
|
val lower = type.lowerBound
|
||||||
val lowerDescriptor = lower.constructor.declarationDescriptor as? ClassDescriptor
|
val lowerDescriptor = lower.constructor.declarationDescriptor as? ClassDescriptor
|
||||||
?: error("No class descriptor for lower type $lower of $type")
|
?: 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)
|
lower.replace(newArguments = upper.arguments)
|
||||||
} else lower
|
} else lower
|
||||||
val mixed = intermediate.makeNullableAsSpecified(upper.isMarkedNullable)
|
val mixed = intermediate.makeNullableAsSpecified(upper.isMarkedNullable)
|
||||||
|
|||||||
@@ -1,16 +1,22 @@
|
|||||||
// TARGET_BACKEND: JVM_IR
|
// TARGET_BACKEND: JVM_IR
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
// FILE: UseRawType.java
|
// FILE: C.java
|
||||||
import java.util.List;
|
public class C<T> {
|
||||||
|
T val;
|
||||||
|
|
||||||
public class UseRawType {
|
public C(T val) { this.val = val; }
|
||||||
static public List useList(List arg) {
|
|
||||||
return arg;
|
public T getVal() { return val; }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// FILE: use.kt
|
// FILE: UseRaw.java
|
||||||
inline fun callRawType() = UseRawType.useList(listOf("OK")) as List<String>
|
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<String>).getVal()
|
||||||
// FILE: box.kt
|
// FILE: box.kt
|
||||||
fun box() = callRawType()[0]
|
fun box() = inlineCallRaw("OK")
|
||||||
Reference in New Issue
Block a user