Spread should always copy arrays.
Introduce a special (package private) utility class ArraysUtilJVM to fix Array<T>.asList() issues.
This commit is contained in:
@@ -91,7 +91,8 @@ public class VarArgTest extends CodegenTestCase {
|
||||
Method main = generateFunction("test");
|
||||
String[] args = {"mama", "papa"};
|
||||
String[] result = (String []) main.invoke(null, new Object[] {args});
|
||||
assertTrue(args == result);
|
||||
assertTrue(args != result);
|
||||
assertTrue(Arrays.equals(args, result));
|
||||
}
|
||||
|
||||
public void testArrayAsVararg2() throws InvocationTargetException, IllegalAccessException {
|
||||
|
||||
+6
@@ -4651,6 +4651,12 @@ public class BlackBoxWithStdlibCodegenTestGenerated extends AbstractBlackBoxCode
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxWithStdlib/vararg"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("spreadCopiesArray.kt")
|
||||
public void testSpreadCopiesArray() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/vararg/spreadCopiesArray.kt");
|
||||
doTestWithStdlib(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("varargInFunParam.kt")
|
||||
public void testVarargInFunParam() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/vararg/varargInFunParam.kt");
|
||||
|
||||
Reference in New Issue
Block a user