[FIR] Properly check for visibility in FirTypeIntersectionScopeContext

This fixes a false positive OVERRIDING_FINAL_MEMBER caused by a
package-private member in a different package being added to the
list of overridden symbols. However, in Java, package-private members
from different packages are effectively like private members in that
they cannot be overridden.

#KT-61696 Fixed
This commit is contained in:
Kirill Rakhman
2023-09-07 17:04:46 +02:00
committed by Space Team
parent d16f33cf5b
commit 2bc25d4f6e
10 changed files with 97 additions and 11 deletions
@@ -24825,6 +24825,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
runTest("compiler/testData/diagnostics/tests/override/clashesOnInheritance/kt9550.kt");
}
@Test
@TestMetadata("packagePrivateAndPublic.kt")
public void testPackagePrivateAndPublic() throws Exception {
runTest("compiler/testData/diagnostics/tests/override/clashesOnInheritance/packagePrivateAndPublic.kt");
}
@Test
@TestMetadata("returnTypeMismatch.kt")
public void testReturnTypeMismatch() throws Exception {
@@ -24825,6 +24825,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
runTest("compiler/testData/diagnostics/tests/override/clashesOnInheritance/kt9550.kt");
}
@Test
@TestMetadata("packagePrivateAndPublic.kt")
public void testPackagePrivateAndPublic() throws Exception {
runTest("compiler/testData/diagnostics/tests/override/clashesOnInheritance/packagePrivateAndPublic.kt");
}
@Test
@TestMetadata("returnTypeMismatch.kt")
public void testReturnTypeMismatch() throws Exception {