diff --git a/compiler/testData/diagnostics/tests/exposed/protectedJava.fir.kt b/compiler/testData/diagnostics/tests/exposed/protectedJava.fir.kt new file mode 100644 index 00000000000..6b66983edd8 --- /dev/null +++ b/compiler/testData/diagnostics/tests/exposed/protectedJava.fir.kt @@ -0,0 +1,16 @@ +// FILE: Outer.java + +public abstract class Outer { + protected static class My {} + protected static class Your extends My {} + abstract protected Your foo(My my); +} + +// FILE: OuterDerived.kt + +class OuterDerived: Outer() { + // valid, My has better visibility + protected class His: Outer.My() + // valid, My and Your have better visibility + override fun foo(my: Outer.My) = Outer.Your() +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/exposed/protectedJava.kt b/compiler/testData/diagnostics/tests/exposed/protectedJava.kt index 670a699a786..29096cf0d16 100644 --- a/compiler/testData/diagnostics/tests/exposed/protectedJava.kt +++ b/compiler/testData/diagnostics/tests/exposed/protectedJava.kt @@ -1,4 +1,3 @@ -// FIR_IDENTICAL // FILE: Outer.java public abstract class Outer { diff --git a/compiler/testData/diagnostics/tests/exposed/protectedSameWay.fir.kt b/compiler/testData/diagnostics/tests/exposed/protectedSameWay.fir.kt new file mode 100644 index 00000000000..22f4c044972 --- /dev/null +++ b/compiler/testData/diagnostics/tests/exposed/protectedSameWay.fir.kt @@ -0,0 +1,13 @@ +abstract class Outer { + protected open class My + // Both valid: same way protected + protected class Your: My() + abstract protected fun foo(my: My): Your +} + +class OuterDerived: Outer() { + // valid, My has better visibility + protected class His: Outer.My() + // valid, My and Your have better visibility + override fun foo(my: Outer.My) = Outer.Your() +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/exposed/protectedSameWay.kt b/compiler/testData/diagnostics/tests/exposed/protectedSameWay.kt index a487d3b0c94..9925008e88c 100644 --- a/compiler/testData/diagnostics/tests/exposed/protectedSameWay.kt +++ b/compiler/testData/diagnostics/tests/exposed/protectedSameWay.kt @@ -1,4 +1,3 @@ -// FIR_IDENTICAL abstract class Outer { protected open class My // Both valid: same way protected