Box inline class return value in lambdas (including suspend lambdas)

This commit is contained in:
Dmitry Petrov
2020-04-08 12:28:17 +03:00
parent 59b72b3156
commit 9615b20e5d
22 changed files with 691 additions and 18 deletions
@@ -6036,6 +6036,16 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/coroutines/inlineClasses"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
}
@TestMetadata("boxReturnValueOfSuspendFunctionReference.kt")
public void testBoxReturnValueOfSuspendFunctionReference() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/boxReturnValueOfSuspendFunctionReference.kt");
}
@TestMetadata("boxReturnValueOfSuspendLambda.kt")
public void testBoxReturnValueOfSuspendLambda() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/boxReturnValueOfSuspendLambda.kt");
}
@TestMetadata("boxUnboxInsideCoroutine.kt")
public void testBoxUnboxInsideCoroutine_1_3() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineClasses/boxUnboxInsideCoroutine.kt", "kotlin.coroutines");
@@ -11039,6 +11049,79 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/inlineClasses/whenWithSubject.kt");
}
@TestMetadata("compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class BoxReturnValueInLambda extends AbstractIrJsCodegenBoxTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath);
}
public void testAllFilesPresentInBoxReturnValueInLambda() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
}
@TestMetadata("boxAny.kt")
public void testBoxAny() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxAny.kt");
}
@TestMetadata("boxFunLiteralAny.kt")
public void testBoxFunLiteralAny() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxFunLiteralAny.kt");
}
@TestMetadata("boxInt.kt")
public void testBoxInt() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxInt.kt");
}
@TestMetadata("boxNullableAny.kt")
public void testBoxNullableAny() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableAny.kt");
}
@TestMetadata("boxNullableAnyNull.kt")
public void testBoxNullableAnyNull() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableAnyNull.kt");
}
@TestMetadata("boxNullableInt.kt")
public void testBoxNullableInt() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableInt.kt");
}
@TestMetadata("boxNullableIntNull.kt")
public void testBoxNullableIntNull() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableIntNull.kt");
}
@TestMetadata("boxNullableString.kt")
public void testBoxNullableString() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableString.kt");
}
@TestMetadata("boxNullableStringNull.kt")
public void testBoxNullableStringNull() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableStringNull.kt");
}
@TestMetadata("boxString.kt")
public void testBoxString() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxString.kt");
}
@TestMetadata("kt27586_1.kt")
public void testKt27586_1() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/kt27586_1.kt");
}
@TestMetadata("kt27586_2.kt")
public void testKt27586_2() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/kt27586_2.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -6036,6 +6036,16 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/coroutines/inlineClasses"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true);
}
@TestMetadata("boxReturnValueOfSuspendFunctionReference.kt")
public void testBoxReturnValueOfSuspendFunctionReference() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/boxReturnValueOfSuspendFunctionReference.kt");
}
@TestMetadata("boxReturnValueOfSuspendLambda.kt")
public void testBoxReturnValueOfSuspendLambda() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/boxReturnValueOfSuspendLambda.kt");
}
@TestMetadata("boxUnboxInsideCoroutine.kt")
public void testBoxUnboxInsideCoroutine_1_3() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineClasses/boxUnboxInsideCoroutine.kt", "kotlin.coroutines");
@@ -11104,6 +11114,79 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/inlineClasses/whenWithSubject.kt");
}
@TestMetadata("compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class BoxReturnValueInLambda extends AbstractJsCodegenBoxTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath);
}
public void testAllFilesPresentInBoxReturnValueInLambda() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true);
}
@TestMetadata("boxAny.kt")
public void testBoxAny() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxAny.kt");
}
@TestMetadata("boxFunLiteralAny.kt")
public void testBoxFunLiteralAny() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxFunLiteralAny.kt");
}
@TestMetadata("boxInt.kt")
public void testBoxInt() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxInt.kt");
}
@TestMetadata("boxNullableAny.kt")
public void testBoxNullableAny() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableAny.kt");
}
@TestMetadata("boxNullableAnyNull.kt")
public void testBoxNullableAnyNull() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableAnyNull.kt");
}
@TestMetadata("boxNullableInt.kt")
public void testBoxNullableInt() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableInt.kt");
}
@TestMetadata("boxNullableIntNull.kt")
public void testBoxNullableIntNull() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableIntNull.kt");
}
@TestMetadata("boxNullableString.kt")
public void testBoxNullableString() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableString.kt");
}
@TestMetadata("boxNullableStringNull.kt")
public void testBoxNullableStringNull() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableStringNull.kt");
}
@TestMetadata("boxString.kt")
public void testBoxString() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxString.kt");
}
@TestMetadata("kt27586_1.kt")
public void testKt27586_1() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/kt27586_1.kt");
}
@TestMetadata("kt27586_2.kt")
public void testKt27586_2() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/kt27586_2.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)