Provide configurable constructor call normalization

Three modes:

- 'disable' (default): normalize constructor calls in coroutines only
  (required because uninitialized objects can't be stored in fields),
  don't insert additional code for forced class initialization;

- 'enable': normalize constructor calls,
  don't insert additional code for forced class initialization;

- 'preserve-class-initialization': normalize constructor calls,
  insert additional code for forced class initialization.
This commit is contained in:
Dmitry Petrov
2017-10-05 16:29:14 +03:00
parent e71090ae4c
commit a89f978597
23 changed files with 323 additions and 33 deletions
@@ -4307,6 +4307,24 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
doTest(fileName);
}
@TestMetadata("inlineFunInConstructorCallWithDisabledNormalization.kt")
public void testInlineFunInConstructorCallWithDisabledNormalization() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/constructorCall/inlineFunInConstructorCallWithDisabledNormalization.kt");
doTest(fileName);
}
@TestMetadata("inlineFunInConstructorCallWithEnabledNormalization.kt")
public void testInlineFunInConstructorCallWithEnabledNormalization() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/constructorCall/inlineFunInConstructorCallWithEnabledNormalization.kt");
doTest(fileName);
}
@TestMetadata("inlineFunInConstructorCallWithStrictNormalization.kt")
public void testInlineFunInConstructorCallWithStrictNormalization() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/constructorCall/inlineFunInConstructorCallWithStrictNormalization.kt");
doTest(fileName);
}
@TestMetadata("inlineFunInInnerClassConstructorCall.kt")
public void testInlineFunInInnerClassConstructorCall() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/constructorCall/inlineFunInInnerClassConstructorCall.kt");