working on signature generation for arrays
* more tests * fix signature generation for Array<Array<Int>>
This commit is contained in:
@@ -234,10 +234,10 @@ public class JetTypeMapper {
|
||||
return mapType(jetType, kind, signatureVisitor, false);
|
||||
}
|
||||
|
||||
@NotNull private Type mapType(JetType jetType, OwnerKind kind, @Nullable SignatureVisitor signatureVisitor, boolean typeParameter) {
|
||||
@NotNull private Type mapType(JetType jetType, OwnerKind kind, @Nullable SignatureVisitor signatureVisitor, boolean boxPrimitive) {
|
||||
Type known = knowTypes.get(jetType);
|
||||
if (known != null) {
|
||||
return mapKnownAsmType(jetType, known, signatureVisitor, typeParameter);
|
||||
return mapKnownAsmType(jetType, known, signatureVisitor, boxPrimitive);
|
||||
}
|
||||
|
||||
DeclarationDescriptor descriptor = jetType.getConstructor().getDeclarationDescriptor();
|
||||
@@ -249,8 +249,7 @@ public class JetTypeMapper {
|
||||
|
||||
if (signatureVisitor != null) {
|
||||
SignatureVisitor arraySignatureVisitor = signatureVisitor.visitArrayType();
|
||||
// TODO: box
|
||||
mapType(memberType, kind, arraySignatureVisitor);
|
||||
mapType(memberType, kind, arraySignatureVisitor, true);
|
||||
}
|
||||
|
||||
if (!isGenericsArray(jetType)) {
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
|
||||
class ArrayOfIntArray {
|
||||
{
|
||||
int[][] a = new int[0][];
|
||||
int[][] r = namespace.ohMy(a);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
fun ohMy(p: Array<IntArray>) = p
|
||||
@@ -0,0 +1,7 @@
|
||||
|
||||
class ArrayOfIntArray {
|
||||
{
|
||||
Integer[][] a = new Integer[0][];
|
||||
Integer[][] r = namespace.ohMy(a, null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
// extra parameter is to make sure generic signature is generated
|
||||
fun ohMy(p: Array<Array<Int>>, ignore: java.util.List<String>) = p
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
class IntArray {
|
||||
{
|
||||
int[] r = namespace.doNothing(new int[0]);
|
||||
int[] r = namespace.doNothing(new int[0], null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
fun doNothing(array: IntArray) = array
|
||||
// extra parameter is to make sure generic signature is not erased
|
||||
fun doNothing(array: IntArray, ignore: java.util.List<String>) = array
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
|
||||
class IntArray {
|
||||
{
|
||||
Integer[] r = namespace.doNothing(new Integer[0], null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
// extra parameter is to make sure generic signature is preserved
|
||||
fun doNothing(array: Array<Int>, ignore: java.util.List<String>) = array
|
||||
Reference in New Issue
Block a user