Fix java visibility publicity
#KT-6478 Fixed
This commit is contained in:
committed by
max.kammerer
parent
5013abe8cd
commit
9e864f3c36
@@ -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()
|
||||||
|
}
|
||||||
+6
@@ -37,6 +37,12 @@ public class BlackBoxWithJavaCodegenTestGenerated extends AbstractBlackBoxCodege
|
|||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxWithJava"), Pattern.compile("^([^\\.]+)$"), true);
|
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")
|
@TestMetadata("referenceToJavaFieldOfKotlinSubclass")
|
||||||
public void testReferenceToJavaFieldOfKotlinSubclass() throws Exception {
|
public void testReferenceToJavaFieldOfKotlinSubclass() throws Exception {
|
||||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithJava/referenceToJavaFieldOfKotlinSubclass/");
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithJava/referenceToJavaFieldOfKotlinSubclass/");
|
||||||
|
|||||||
+2
-2
@@ -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
|
@Override
|
||||||
protected boolean isVisible(@NotNull ReceiverValue receiver, @NotNull DeclarationDescriptorWithVisibility what, @NotNull DeclarationDescriptor from) {
|
protected boolean isVisible(@NotNull ReceiverValue receiver, @NotNull DeclarationDescriptorWithVisibility what, @NotNull DeclarationDescriptor from) {
|
||||||
if (areInSamePackage(what, 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
|
@Override
|
||||||
protected boolean isVisible(@NotNull ReceiverValue receiver, @NotNull DeclarationDescriptorWithVisibility what, @NotNull DeclarationDescriptor from) {
|
protected boolean isVisible(@NotNull ReceiverValue receiver, @NotNull DeclarationDescriptorWithVisibility what, @NotNull DeclarationDescriptor from) {
|
||||||
if (areInSamePackage(what, from)) {
|
if (areInSamePackage(what, from)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user