[FIR] Ignore private properties in accessor override check

JavaClassUseSiteMemberScope won't return a Java method getFoo if there
is an inherited Kotlin property foo in scope because calling this method
would effectively call the property accessor which is not possible in
Kotlin.
This commit excludes private properties from this consideration because
no accessor methods are generated for them, and so calling a Java method
getFoo is ok.

#KT-58577 Fixed
This commit is contained in:
Kirill Rakhman
2023-05-10 17:48:31 +02:00
committed by Space Team
parent 442844f165
commit 993925f656
8 changed files with 82 additions and 0 deletions
@@ -19732,6 +19732,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
runTest("compiler/testData/diagnostics/tests/j+k/privateNestedClassStaticMember.kt");
}
@Test
@TestMetadata("privatePropertyAndSetterMultiModule.kt")
public void testPrivatePropertyAndSetterMultiModule() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/privatePropertyAndSetterMultiModule.kt");
}
@Test
@TestMetadata("protectedStaticSamePackage.kt")
public void testProtectedStaticSamePackage() throws Exception {
@@ -19732,6 +19732,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
runTest("compiler/testData/diagnostics/tests/j+k/privateNestedClassStaticMember.kt");
}
@Test
@TestMetadata("privatePropertyAndSetterMultiModule.kt")
public void testPrivatePropertyAndSetterMultiModule() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/privatePropertyAndSetterMultiModule.kt");
}
@Test
@TestMetadata("protectedStaticSamePackage.kt")
public void testProtectedStaticSamePackage() throws Exception {