From 4c639a840d91352f12d581c6acf1bbee346f3329 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Thu, 16 Apr 2020 19:14:22 +0300 Subject: [PATCH] [FIR] Apply bad test data (protected eff. visibility related, KT-38401) --- .../tests/exposed/protectedJava.fir.kt | 16 ++++++++++++++++ .../diagnostics/tests/exposed/protectedJava.kt | 1 - .../tests/exposed/protectedSameWay.fir.kt | 13 +++++++++++++ .../tests/exposed/protectedSameWay.kt | 1 - 4 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 compiler/testData/diagnostics/tests/exposed/protectedJava.fir.kt create mode 100644 compiler/testData/diagnostics/tests/exposed/protectedSameWay.fir.kt 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