Generate 'Deprecated' annotation on invisible companion object field

Design decision: if the field for a companion object should have
non-public visibility, generate it with @Deprecated annotation in
language version 1.2.

TODO: generate it with proper visibility in 1.3 and later.

KT-11567 Companion object INSTANCE field more visible than companion object class itself
This commit is contained in:
Dmitry Petrov
2017-07-18 15:25:24 +03:00
parent 951392005b
commit 891799c853
7 changed files with 143 additions and 6 deletions
@@ -90,6 +90,18 @@ public class BytecodeListingTestGenerated extends AbstractBytecodeListingTest {
doTest(fileName);
}
@TestMetadata("invisibleCompanionObject.kt")
public void testInvisibleCompanionObject() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeListing/invisibleCompanionObject.kt");
doTest(fileName);
}
@TestMetadata("invisibleCompanionObject_lv11.kt")
public void testInvisibleCompanionObject_lv11() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeListing/invisibleCompanionObject_lv11.kt");
doTest(fileName);
}
@TestMetadata("jvmOverloadsAndParametersAnnotations.kt")
public void testJvmOverloadsAndParametersAnnotations() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeListing/jvmOverloadsAndParametersAnnotations.kt");