[JS IR BE] Fix VarargLowering

- Enable empty vararg transformation for all IrFunctionAccessExpression
- Fix empty vararg boxing
- Refactor inline class boxing logic
- Fix types of generated expressions
This commit is contained in:
Svyatoslav Kuzmich
2019-05-19 01:27:34 +03:00
parent f80b6ff947
commit 59617c97b4
5 changed files with 220 additions and 49 deletions
@@ -6778,6 +6778,24 @@ public class IrBoxJsTestGenerated extends AbstractIrBoxJsTest {
runTest("js/js.translator/testData/box/regression/stdlibTestSnippets/throwable.kt");
}
}
@TestMetadata("js/js.translator/testData/box/regression/typeChecks")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class TypeChecks extends AbstractIrBoxJsTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath);
}
public void testAllFilesPresentInTypeChecks() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/box/regression/typeChecks"), Pattern.compile("^([^_](.+))\\.kt$"), TargetBackend.JS_IR, true);
}
@TestMetadata("emptyVarargInConstructorCall.kt")
public void testEmptyVarargInConstructorCall() throws Exception {
runTest("js/js.translator/testData/box/regression/typeChecks/emptyVarargInConstructorCall.kt");
}
}
}
@TestMetadata("js/js.translator/testData/box/reified")
@@ -6813,6 +6813,24 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest {
runTest("js/js.translator/testData/box/regression/stdlibTestSnippets/throwable.kt");
}
}
@TestMetadata("js/js.translator/testData/box/regression/typeChecks")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class TypeChecks extends AbstractBoxJsTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath);
}
public void testAllFilesPresentInTypeChecks() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/box/regression/typeChecks"), Pattern.compile("^([^_](.+))\\.kt$"), TargetBackend.JS, true);
}
@TestMetadata("emptyVarargInConstructorCall.kt")
public void testEmptyVarargInConstructorCall() throws Exception {
runTest("js/js.translator/testData/box/regression/typeChecks/emptyVarargInConstructorCall.kt");
}
}
}
@TestMetadata("js/js.translator/testData/box/reified")