Fix JVM signature mapping for multi-dimensional arrays
#KT-11314 Fixed
This commit is contained in:
@@ -18,6 +18,7 @@ package org.jetbrains.kotlin.codegen.signature;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.codegen.AsmUtil;
|
||||
import org.jetbrains.kotlin.load.kotlin.JvmDescriptorTypeWriter;
|
||||
import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodGenericSignature;
|
||||
import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodParameterKind;
|
||||
@@ -57,7 +58,7 @@ public class JvmSignatureWriter extends JvmDescriptorTypeWriter<Type> {
|
||||
return;
|
||||
case Type.ARRAY:
|
||||
writeArrayType();
|
||||
writeAsmType(asmType.getElementType());
|
||||
writeAsmType(AsmUtil.correctElementType(asmType));
|
||||
writeArrayEnd();
|
||||
return;
|
||||
default:
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// WITH_RUNTIME
|
||||
abstract class Table<T>(
|
||||
val content: Array<Array<T>>
|
||||
)
|
||||
|
||||
fun box(): String {
|
||||
val x = object : Table<String>(
|
||||
Array(1, {
|
||||
x-> Array(1, {y -> "OK"})
|
||||
})
|
||||
) {}
|
||||
|
||||
return x.content[0][0]
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
@kotlin.Metadata
|
||||
public final class GenericArrayInObjectLiteralConstructorKt {
|
||||
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public abstract class Table {
|
||||
private final @org.jetbrains.annotations.NotNull field content: java.lang.Object[][]
|
||||
public method <init>(@org.jetbrains.annotations.NotNull p0: java.lang.Object[][]): void
|
||||
public final @org.jetbrains.annotations.NotNull method getContent(): java.lang.Object[][]
|
||||
}
|
||||
+6
@@ -377,6 +377,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("genericArrayInObjectLiteralConstructor.kt")
|
||||
public void testGenericArrayInObjectLiteralConstructor() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/arrays/genericArrayInObjectLiteralConstructor.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("hashMap.kt")
|
||||
public void testHashMap() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/arrays/hashMap.kt");
|
||||
|
||||
@@ -377,6 +377,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("genericArrayInObjectLiteralConstructor.kt")
|
||||
public void testGenericArrayInObjectLiteralConstructor() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/arrays/genericArrayInObjectLiteralConstructor.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("hashMap.kt")
|
||||
public void testHashMap() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/arrays/hashMap.kt");
|
||||
|
||||
@@ -527,6 +527,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("genericArrayInObjectLiteralConstructor.kt")
|
||||
public void testGenericArrayInObjectLiteralConstructor() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/arrays/genericArrayInObjectLiteralConstructor.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("hashMap.kt")
|
||||
public void testHashMap() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/arrays/hashMap.kt");
|
||||
|
||||
Reference in New Issue
Block a user