diff --git a/compiler/testData/codegen/boxWithJava/inline/Test.java b/compiler/testData/codegen/boxWithJava/inline/Test.java new file mode 100644 index 00000000000..083be6c0664 --- /dev/null +++ b/compiler/testData/codegen/boxWithJava/inline/Test.java @@ -0,0 +1,13 @@ +public class Test { + + protected String data = "O"; + + protected Test() { + + } + + protected static String testStatic() { + return "K"; + } + +} \ No newline at end of file diff --git a/compiler/testData/codegen/boxWithJava/inline/javaProtectedVisibility.kt b/compiler/testData/codegen/boxWithJava/inline/javaProtectedVisibility.kt new file mode 100644 index 00000000000..b8635015f98 --- /dev/null +++ b/compiler/testData/codegen/boxWithJava/inline/javaProtectedVisibility.kt @@ -0,0 +1,10 @@ + +public inline fun test(): String { + val p = object : Test() {} + return p.data + Test.testStatic(); +} + + +fun box(): String { + return test() +} \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/jet/codegen/generated/BlackBoxWithJavaCodegenTestGenerated.java b/compiler/tests/org/jetbrains/jet/codegen/generated/BlackBoxWithJavaCodegenTestGenerated.java index b15fcfd0772..ccf65c05f72 100644 --- a/compiler/tests/org/jetbrains/jet/codegen/generated/BlackBoxWithJavaCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/codegen/generated/BlackBoxWithJavaCodegenTestGenerated.java @@ -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/"); diff --git a/core/descriptor.loader.java/src/org/jetbrains/jet/lang/resolve/java/JavaVisibilities.java b/core/descriptor.loader.java/src/org/jetbrains/jet/lang/resolve/java/JavaVisibilities.java index 4aaa15095d8..d12197ae6f0 100644 --- a/core/descriptor.loader.java/src/org/jetbrains/jet/lang/resolve/java/JavaVisibilities.java +++ b/core/descriptor.loader.java/src/org/jetbrains/jet/lang/resolve/java/JavaVisibilities.java @@ -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)) {