diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/JetTypeMapper.java b/compiler/backend/src/org/jetbrains/jet/codegen/JetTypeMapper.java index 8ed9283d6f0..0c3ba19bbbf 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/JetTypeMapper.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/JetTypeMapper.java @@ -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)) { diff --git a/compiler/testData/compileJavaAgainstKotlin/ArrayOfIntArray.java b/compiler/testData/compileJavaAgainstKotlin/ArrayOfIntArray.java new file mode 100644 index 00000000000..e53cd061eca --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/ArrayOfIntArray.java @@ -0,0 +1,7 @@ + +class ArrayOfIntArray { + { + int[][] a = new int[0][]; + int[][] r = namespace.ohMy(a); + } +} diff --git a/compiler/testData/compileJavaAgainstKotlin/ArrayOfIntArray.kt b/compiler/testData/compileJavaAgainstKotlin/ArrayOfIntArray.kt new file mode 100644 index 00000000000..a64acfd5de4 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/ArrayOfIntArray.kt @@ -0,0 +1 @@ +fun ohMy(p: Array) = p diff --git a/compiler/testData/compileJavaAgainstKotlin/ArrayOfIntegerArray.java b/compiler/testData/compileJavaAgainstKotlin/ArrayOfIntegerArray.java new file mode 100644 index 00000000000..4294970558f --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/ArrayOfIntegerArray.java @@ -0,0 +1,7 @@ + +class ArrayOfIntArray { + { + Integer[][] a = new Integer[0][]; + Integer[][] r = namespace.ohMy(a, null); + } +} diff --git a/compiler/testData/compileJavaAgainstKotlin/ArrayOfIntegerArray.kt b/compiler/testData/compileJavaAgainstKotlin/ArrayOfIntegerArray.kt new file mode 100644 index 00000000000..78f9664434c --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/ArrayOfIntegerArray.kt @@ -0,0 +1,2 @@ +// extra parameter is to make sure generic signature is generated +fun ohMy(p: Array>, ignore: java.util.List) = p diff --git a/compiler/testData/compileJavaAgainstKotlin/IntArray.java b/compiler/testData/compileJavaAgainstKotlin/IntArray.java index e0bdaa635ee..e32c42f8ace 100644 --- a/compiler/testData/compileJavaAgainstKotlin/IntArray.java +++ b/compiler/testData/compileJavaAgainstKotlin/IntArray.java @@ -1,6 +1,6 @@ class IntArray { { - int[] r = namespace.doNothing(new int[0]); + int[] r = namespace.doNothing(new int[0], null); } } diff --git a/compiler/testData/compileJavaAgainstKotlin/IntArray.kt b/compiler/testData/compileJavaAgainstKotlin/IntArray.kt index 2abd2b34c5a..70f76451481 100644 --- a/compiler/testData/compileJavaAgainstKotlin/IntArray.kt +++ b/compiler/testData/compileJavaAgainstKotlin/IntArray.kt @@ -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) = array diff --git a/compiler/testData/compileJavaAgainstKotlin/IntegerArray.java b/compiler/testData/compileJavaAgainstKotlin/IntegerArray.java new file mode 100644 index 00000000000..3f73cc43ca1 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/IntegerArray.java @@ -0,0 +1,6 @@ + +class IntArray { + { + Integer[] r = namespace.doNothing(new Integer[0], null); + } +} diff --git a/compiler/testData/compileJavaAgainstKotlin/IntegerArray.kt b/compiler/testData/compileJavaAgainstKotlin/IntegerArray.kt new file mode 100644 index 00000000000..6d241620970 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/IntegerArray.kt @@ -0,0 +1,2 @@ +// extra parameter is to make sure generic signature is preserved +fun doNothing(array: Array, ignore: java.util.List) = array