JVM_IR: move ArrayConstructor below function reference phases

This allows taking function references to inline array constructors.

Also, redundant classes are no longer generated when function references
are passed as arguments to the array constructors.

 #KT-46426 Fixed
This commit is contained in:
pyos
2021-05-04 16:13:39 +02:00
committed by TeamCityServer
parent 776920f77d
commit 9f53d70109
15 changed files with 168 additions and 45 deletions
@@ -1465,6 +1465,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
runTest("compiler/testData/codegen/box/callableReference/genericLocalClassConstructorReference.kt");
}
@TestMetadata("inlineArrayConstructors.kt")
public void testInlineArrayConstructors() throws Exception {
runTest("compiler/testData/codegen/box/callableReference/inlineArrayConstructors.kt");
}
@TestMetadata("kt21014.kt")
public void testKt21014() throws Exception {
runTest("compiler/testData/codegen/box/callableReference/kt21014.kt");
@@ -1733,6 +1738,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
runTest("compiler/testData/codegen/box/callableReference/bound/array.kt");
}
@TestMetadata("arrayConstructorArgument.kt")
public void testArrayConstructorArgument() throws Exception {
runTest("compiler/testData/codegen/box/callableReference/bound/arrayConstructorArgument.kt");
}
@TestMetadata("arrayGetIntrinsic.kt")
public void testArrayGetIntrinsic() throws Exception {
runTest("compiler/testData/codegen/box/callableReference/bound/arrayGetIntrinsic.kt");
@@ -1465,6 +1465,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/callableReference/genericLocalClassConstructorReference.kt");
}
@TestMetadata("inlineArrayConstructors.kt")
public void testInlineArrayConstructors() throws Exception {
runTest("compiler/testData/codegen/box/callableReference/inlineArrayConstructors.kt");
}
@TestMetadata("kt21014.kt")
public void testKt21014() throws Exception {
runTest("compiler/testData/codegen/box/callableReference/kt21014.kt");
@@ -1733,6 +1738,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/callableReference/bound/array.kt");
}
@TestMetadata("arrayConstructorArgument.kt")
public void testArrayConstructorArgument() throws Exception {
runTest("compiler/testData/codegen/box/callableReference/bound/arrayConstructorArgument.kt");
}
@TestMetadata("arrayGetIntrinsic.kt")
public void testArrayGetIntrinsic() throws Exception {
runTest("compiler/testData/codegen/box/callableReference/bound/arrayGetIntrinsic.kt");
@@ -1465,6 +1465,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/callableReference/genericLocalClassConstructorReference.kt");
}
@TestMetadata("inlineArrayConstructors.kt")
public void testInlineArrayConstructors() throws Exception {
runTest("compiler/testData/codegen/box/callableReference/inlineArrayConstructors.kt");
}
@TestMetadata("kt21014.kt")
public void testKt21014() throws Exception {
runTest("compiler/testData/codegen/box/callableReference/kt21014.kt");
@@ -1733,6 +1738,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/callableReference/bound/array.kt");
}
@TestMetadata("arrayConstructorArgument.kt")
public void testArrayConstructorArgument() throws Exception {
runTest("compiler/testData/codegen/box/callableReference/bound/arrayConstructorArgument.kt");
}
@TestMetadata("arrayGetIntrinsic.kt")
public void testArrayGetIntrinsic() throws Exception {
runTest("compiler/testData/codegen/box/callableReference/bound/arrayGetIntrinsic.kt");
@@ -1265,6 +1265,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/callableReference"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true);
}
@TestMetadata("inlineArrayConstructors.kt")
public void testInlineArrayConstructors() throws Exception {
runTest("compiler/testData/codegen/box/callableReference/inlineArrayConstructors.kt");
}
@TestMetadata("kt37604.kt")
public void testKt37604() throws Exception {
runTest("compiler/testData/codegen/box/callableReference/kt37604.kt");
@@ -1358,6 +1363,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/callableReference/bound"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true);
}
@TestMetadata("arrayConstructorArgument.kt")
public void testArrayConstructorArgument() throws Exception {
runTest("compiler/testData/codegen/box/callableReference/bound/arrayConstructorArgument.kt");
}
@TestMetadata("captureVarInInitBlock.kt")
public void testCaptureVarInInitBlock() throws Exception {
runTest("compiler/testData/codegen/box/callableReference/bound/captureVarInInitBlock.kt");