JVM IR: Fix handling of anonymous initializers in inline classes (#4372)

Fixes KT-46554
This commit is contained in:
Steven Schäfer
2021-05-11 11:42:11 +02:00
committed by Alexander Udalov
parent cc4c61d2b3
commit b2378620c3
14 changed files with 320 additions and 51 deletions
@@ -30,6 +30,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
}
@TestMetadata("boxImplDoesNotExecuteInSecondaryConstructor.kt")
public void testBoxImplDoesNotExecuteInSecondaryConstructor() throws Exception {
runTest("compiler/testData/codegen/box/boxImplDoesNotExecuteInSecondaryConstructor.kt");
}
@TestMetadata("compiler/testData/codegen/box/annotations")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -12861,6 +12866,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
runTest("compiler/testData/codegen/box/inlineClasses/checkUnboxingResultFromTypeVariable.kt");
}
@TestMetadata("classInInlineClassInit.kt")
public void testClassInInlineClassInit() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/classInInlineClassInit.kt");
}
@TestMetadata("computablePropertyInsideInlineClass.kt")
public void testComputablePropertyInsideInlineClass() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/computablePropertyInsideInlineClass.kt");
@@ -13041,11 +13051,21 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassEqualityShouldUseTotalOrderForFloatingPointData.kt");
}
@TestMetadata("inlineClassFieldHandling.kt")
public void testInlineClassFieldHandling() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassFieldHandling.kt");
}
@TestMetadata("inlineClassFunctionInvoke.kt")
public void testInlineClassFunctionInvoke() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassFunctionInvoke.kt");
}
@TestMetadata("inlineClassInInitBlock.kt")
public void testInlineClassInInitBlock() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassInInitBlock.kt");
}
@TestMetadata("inlineClassInStringTemplate.kt")
public void testInlineClassInStringTemplate() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassInStringTemplate.kt");
@@ -13311,6 +13331,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
runTest("compiler/testData/codegen/box/inlineClasses/kt45991.kt");
}
@TestMetadata("kt46554.kt")
public void testKt46554() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/kt46554.kt");
}
@TestMetadata("mangledDefaultParameterFunction.kt")
public void testMangledDefaultParameterFunction() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/mangledDefaultParameterFunction.kt");
@@ -30,6 +30,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true, "compileKotlinAgainstKotlin");
}
@TestMetadata("boxImplDoesNotExecuteInSecondaryConstructor.kt")
public void testBoxImplDoesNotExecuteInSecondaryConstructor() throws Exception {
runTest("compiler/testData/codegen/box/boxImplDoesNotExecuteInSecondaryConstructor.kt");
}
@TestMetadata("compiler/testData/codegen/box/annotations")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -12267,6 +12272,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/inlineClasses/checkUnboxingResultFromTypeVariable.kt");
}
@TestMetadata("classInInlineClassInit.kt")
public void testClassInInlineClassInit() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/classInInlineClassInit.kt");
}
@TestMetadata("computablePropertyInsideInlineClass.kt")
public void testComputablePropertyInsideInlineClass() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/computablePropertyInsideInlineClass.kt");
@@ -12447,11 +12457,21 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassEqualityShouldUseTotalOrderForFloatingPointData.kt");
}
@TestMetadata("inlineClassFieldHandling.kt")
public void testInlineClassFieldHandling() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassFieldHandling.kt");
}
@TestMetadata("inlineClassFunctionInvoke.kt")
public void testInlineClassFunctionInvoke() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassFunctionInvoke.kt");
}
@TestMetadata("inlineClassInInitBlock.kt")
public void testInlineClassInInitBlock() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassInInitBlock.kt");
}
@TestMetadata("inlineClassInStringTemplate.kt")
public void testInlineClassInStringTemplate() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassInStringTemplate.kt");
@@ -12717,6 +12737,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/inlineClasses/kt45991.kt");
}
@TestMetadata("kt46554.kt")
public void testKt46554() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/kt46554.kt");
}
@TestMetadata("mangledDefaultParameterFunction.kt")
public void testMangledDefaultParameterFunction() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/mangledDefaultParameterFunction.kt");
@@ -30,6 +30,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true, "compileKotlinAgainstKotlin");
}
@TestMetadata("boxImplDoesNotExecuteInSecondaryConstructor.kt")
public void testBoxImplDoesNotExecuteInSecondaryConstructor() throws Exception {
runTest("compiler/testData/codegen/box/boxImplDoesNotExecuteInSecondaryConstructor.kt");
}
@TestMetadata("compiler/testData/codegen/box/annotations")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -12332,6 +12337,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/inlineClasses/checkUnboxingResultFromTypeVariable.kt");
}
@TestMetadata("classInInlineClassInit.kt")
public void testClassInInlineClassInit() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/classInInlineClassInit.kt");
}
@TestMetadata("computablePropertyInsideInlineClass.kt")
public void testComputablePropertyInsideInlineClass() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/computablePropertyInsideInlineClass.kt");
@@ -12512,11 +12522,21 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassEqualityShouldUseTotalOrderForFloatingPointData.kt");
}
@TestMetadata("inlineClassFieldHandling.kt")
public void testInlineClassFieldHandling() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassFieldHandling.kt");
}
@TestMetadata("inlineClassFunctionInvoke.kt")
public void testInlineClassFunctionInvoke() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassFunctionInvoke.kt");
}
@TestMetadata("inlineClassInInitBlock.kt")
public void testInlineClassInInitBlock() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassInInitBlock.kt");
}
@TestMetadata("inlineClassInStringTemplate.kt")
public void testInlineClassInStringTemplate() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassInStringTemplate.kt");
@@ -12782,6 +12802,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/inlineClasses/kt45991.kt");
}
@TestMetadata("kt46554.kt")
public void testKt46554() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/kt46554.kt");
}
@TestMetadata("mangledDefaultParameterFunction.kt")
public void testMangledDefaultParameterFunction() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/mangledDefaultParameterFunction.kt");
@@ -30,6 +30,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true, "toArray", "classLiteral", "reflection", "contracts", "platformTypes", "ranges/stepped/unsigned", "coroutines", "parametersMetadata", "finally", "deadCodeElimination", "controlStructures/tryCatchInExpressions", "delegatedProperty", "compileKotlinAgainstKotlin");
}
@TestMetadata("boxImplDoesNotExecuteInSecondaryConstructor.kt")
public void testBoxImplDoesNotExecuteInSecondaryConstructor() throws Exception {
runTest("compiler/testData/codegen/box/boxImplDoesNotExecuteInSecondaryConstructor.kt");
}
@TestMetadata("compiler/testData/codegen/box/annotations")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -6552,6 +6557,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
runTest("compiler/testData/codegen/box/inlineClasses/checkUnboxingResultFromTypeVariable.kt");
}
@TestMetadata("classInInlineClassInit.kt")
public void testClassInInlineClassInit() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/classInInlineClassInit.kt");
}
@TestMetadata("computablePropertyInsideInlineClass.kt")
public void testComputablePropertyInsideInlineClass() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/computablePropertyInsideInlineClass.kt");
@@ -6697,11 +6707,21 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassEqualityShouldUseTotalOrderForFloatingPointData.kt");
}
@TestMetadata("inlineClassFieldHandling.kt")
public void testInlineClassFieldHandling() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassFieldHandling.kt");
}
@TestMetadata("inlineClassFunctionInvoke.kt")
public void testInlineClassFunctionInvoke() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassFunctionInvoke.kt");
}
@TestMetadata("inlineClassInInitBlock.kt")
public void testInlineClassInInitBlock() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassInInitBlock.kt");
}
@TestMetadata("inlineClassInStringTemplate.kt")
public void testInlineClassInStringTemplate() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassInStringTemplate.kt");
@@ -6932,6 +6952,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
runTest("compiler/testData/codegen/box/inlineClasses/kt45991.kt");
}
@TestMetadata("kt46554.kt")
public void testKt46554() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/kt46554.kt");
}
@TestMetadata("mangledDefaultParameterFunction.kt")
public void testMangledDefaultParameterFunction() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/mangledDefaultParameterFunction.kt");