Do not copy immediately created arrays in spread arguments

E.g., 'foo(x = *intArrayOf(42))'.

 #KT-20462 Fixed
This commit is contained in:
Dmitry Petrov
2017-09-27 16:14:09 +03:00
parent 0d5a2a7e18
commit 73724bcdc7
8 changed files with 234 additions and 4 deletions
@@ -2202,6 +2202,21 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
}
}
@TestMetadata("compiler/testData/codegen/bytecodeText/varargs")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Varargs extends AbstractBytecodeTextTest {
public void testAllFilesPresentInVarargs() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/bytecodeText/varargs"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
}
@TestMetadata("doNotCopyImmediatelyCreatedArrays.kt")
public void testDoNotCopyImmediatelyCreatedArrays() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/varargs/doNotCopyImmediatelyCreatedArrays.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/codegen/bytecodeText/when")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)