Fix java visibility publicity

#KT-6478 Fixed
This commit is contained in:
Michael Bogdanov
2014-12-19 10:43:38 +03:00
committed by max.kammerer
parent 5013abe8cd
commit 9e864f3c36
4 changed files with 31 additions and 2 deletions
@@ -0,0 +1,13 @@
public class Test {
protected String data = "O";
protected Test() {
}
protected static String testStatic() {
return "K";
}
}
@@ -0,0 +1,10 @@
public inline fun test(): String {
val p = object : Test() {}
return p.data + Test.testStatic();
}
fun box(): String {
return test()
}
@@ -37,6 +37,12 @@ public class BlackBoxWithJavaCodegenTestGenerated extends AbstractBlackBoxCodege
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxWithJava"), Pattern.compile("^([^\\.]+)$"), true);
}
@TestMetadata("inline")
public void testInline() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithJava/inline/");
doTestWithJava(fileName);
}
@TestMetadata("referenceToJavaFieldOfKotlinSubclass")
public void testReferenceToJavaFieldOfKotlinSubclass() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithJava/referenceToJavaFieldOfKotlinSubclass/");
@@ -50,7 +50,7 @@ public class JavaVisibilities {
}
};
public static final Visibility PROTECTED_STATIC_VISIBILITY = new Visibility("protected_static", false) {
public static final Visibility PROTECTED_STATIC_VISIBILITY = new Visibility("protected_static", true) {
@Override
protected boolean isVisible(@NotNull ReceiverValue receiver, @NotNull DeclarationDescriptorWithVisibility what, @NotNull DeclarationDescriptor from) {
if (areInSamePackage(what, from)) {
@@ -82,7 +82,7 @@ public class JavaVisibilities {
}
};
public static final Visibility PROTECTED_AND_PACKAGE = new Visibility("protected_and_package", false) {
public static final Visibility PROTECTED_AND_PACKAGE = new Visibility("protected_and_package", true) {
@Override
protected boolean isVisible(@NotNull ReceiverValue receiver, @NotNull DeclarationDescriptorWithVisibility what, @NotNull DeclarationDescriptor from) {
if (areInSamePackage(what, from)) {