[FIR] Don't report EXPOSED_FUNCTION_RETURN_TYPE on property accessors

This commit is contained in:
Dmitriy Novozhilov
2021-06-30 15:09:42 +03:00
committed by TeamCityServer
parent 3a34a2ca62
commit f7c68afb18
7 changed files with 69 additions and 1 deletions
@@ -30930,6 +30930,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
public void testLackOfInvisibleSetterOfJavaClassInSamePackage() throws Exception {
runTest("compiler/testData/diagnostics/tests/visibility/lackOfInvisibleSetterOfJavaClassInSamePackage.kt");
}
@Test
@TestMetadata("protectedInternal.kt")
public void testProtectedInternal() throws Exception {
runTest("compiler/testData/diagnostics/tests/visibility/protectedInternal.kt");
}
}
@Nested
@@ -30930,6 +30930,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
public void testLackOfInvisibleSetterOfJavaClassInSamePackage() throws Exception {
runTest("compiler/testData/diagnostics/tests/visibility/lackOfInvisibleSetterOfJavaClassInSamePackage.kt");
}
@Test
@TestMetadata("protectedInternal.kt")
public void testProtectedInternal() throws Exception {
runTest("compiler/testData/diagnostics/tests/visibility/protectedInternal.kt");
}
}
@Nested
@@ -110,7 +110,7 @@ object FirExposedVisibilityDeclarationChecker : FirBasicDeclarationChecker() {
val functionVisibility = (declaration as FirMemberDeclaration).effectiveVisibility
if (functionVisibility == EffectiveVisibility.Local) return
if (declaration !is FirConstructor) {
if (declaration !is FirConstructor && declaration !is FirPropertyAccessor) {
val restricting = declaration.returnTypeRef.coneTypeSafe<ConeKotlinType>()
?.findVisibilityExposure(context, functionVisibility)
if (restricting != null) {