Skip property accessors for constants

- Inline protected constants from Java at use sites
 - Do not create accessors for private constants in Kotlin

 #KT-11734 In Progress
This commit is contained in:
Mikhail Zarechenskiy
2016-12-05 12:02:43 +03:00
parent bd14c24592
commit 8c1e165f18
12 changed files with 151 additions and 14 deletions
@@ -138,6 +138,12 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
doTest(fileName);
}
@TestMetadata("inlineProtectedJavaConstantFromOtherPackage.kt")
public void testInlineProtectedJavaConstantFromOtherPackage() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/inlineProtectedJavaConstantFromOtherPackage.kt");
doTest(fileName);
}
@TestMetadata("intConstantNotNull.kt")
public void testIntConstantNotNull() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/intConstantNotNull.kt");
@@ -270,6 +276,12 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
doTest(fileName);
}
@TestMetadata("noInlineJavaProtectedConstants.kt")
public void testNoInlineJavaProtectedConstants() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/noInlineJavaProtectedConstants.kt");
doTest(fileName);
}
@TestMetadata("noNumberCheckCast.kt")
public void testNoNumberCheckCast() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/noNumberCheckCast.kt");
@@ -712,10 +724,22 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class ConstProperty extends AbstractBytecodeTextTest {
@TestMetadata("accessorsForPrivateConstants.kt")
public void testAccessorsForPrivateConstants() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/constProperty/accessorsForPrivateConstants.kt");
doTest(fileName);
}
public void testAllFilesPresentInConstProperty() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/bytecodeText/constProperty"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
}
@TestMetadata("noAccessorsForPrivateConstants.kt")
public void testNoAccessorsForPrivateConstants() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/constProperty/noAccessorsForPrivateConstants.kt");
doTest(fileName);
}
@TestMetadata("noInline.kt")
public void testNoInline() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/constProperty/noInline.kt");