diff --git a/idea/src/org/jetbrains/kotlin/idea/intentions/ChangeVisibilityModifierIntention.kt b/idea/src/org/jetbrains/kotlin/idea/intentions/ChangeVisibilityModifierIntention.kt index 5c435d7abee..78cb8849bb1 100644 --- a/idea/src/org/jetbrains/kotlin/idea/intentions/ChangeVisibilityModifierIntention.kt +++ b/idea/src/org/jetbrains/kotlin/idea/intentions/ChangeVisibilityModifierIntention.kt @@ -39,12 +39,12 @@ open class ChangeVisibilityModifierIntention protected constructor( val modifierList = element.modifierList if (modifierList?.hasModifier(modifier) == true) return null + if (KtPsiUtil.isLocal((element as? KtPropertyAccessor)?.property ?: element)) return null + val descriptor = element.toDescriptor() as? DeclarationDescriptorWithVisibility ?: return null val targetVisibility = modifier.toVisibility() if (descriptor.visibility == targetVisibility) return null - if (KtPsiUtil.isLocal((element as? KtPropertyAccessor)?.property ?: element)) return null - if (modifierList?.hasModifier(KtTokens.OVERRIDE_KEYWORD) == true) { val callableDescriptor = descriptor as? CallableDescriptor ?: return null // cannot make visibility less than (or non-comparable with) any of the supers