Support val initialization in non-inline function with EXACTLY_ONCE effect

by generating a box for the value.
 #KT-26126 Fixed
This commit is contained in:
Ilmir Usmanov
2018-12-26 21:31:46 +03:00
parent a52f430d8f
commit 8a01da6ec6
20 changed files with 278 additions and 73 deletions
@@ -4473,6 +4473,24 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
}
}
@TestMetadata("compiler/testData/codegen/box/contracts")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Contracts extends AbstractBlackBoxCodegenTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
}
public void testAllFilesPresentInContracts() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/contracts"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
}
@TestMetadata("exactlyOnceNotInline.kt")
public void testExactlyOnceNotInline() throws Exception {
runTest("compiler/testData/codegen/box/contracts/exactlyOnceNotInline.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/controlStructures")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)