Fix problem with empty vararg of boxed primitives in JVM_IR
When calling a generic Java generic method with vararg parameters with empty
vararg, incorrect array creation instruction was generated for primitive type:
NEWARRAY T_INT instead of ANEWARRAY java/lang/Integer. Here for Java method
public static <T> void takesVarargOfT(T x1, T... xs) {}
corresponding vararg parameter was considered to be of type 'Array<T>?',
which is not a non-null array type, so, NewArray intrinsic failed to generate
proper bytecode.
This commit is contained in:
+5
@@ -27118,6 +27118,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/vararg/doNotCopyImmediatelyCreatedArrays.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("emptyVarargOfBoxedPrimitiveType.kt")
|
||||
public void testEmptyVarargOfBoxedPrimitiveType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/vararg/emptyVarargOfBoxedPrimitiveType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt1978.kt")
|
||||
public void testKt1978() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/vararg/kt1978.kt");
|
||||
|
||||
Reference in New Issue
Block a user