Make internal: don't suggest in interface
#KT-35346 Fixed
This commit is contained in:
committed by
klunnii
parent
6e8565917e
commit
4144adf4ee
@@ -348,7 +348,10 @@ fun KtModifierListOwner.canBeProtected(): Boolean {
|
||||
}
|
||||
|
||||
fun KtModifierListOwner.canBeInternal(): Boolean {
|
||||
if (containingClass()?.isInterface() == true && hasJvmFieldAnnotation()) return false
|
||||
if (containingClass()?.isInterface() == true) {
|
||||
val objectDeclaration = getStrictParentOfType<KtObjectDeclaration>() ?: return false
|
||||
if (objectDeclaration.isCompanion() && hasJvmFieldAnnotation()) return false
|
||||
}
|
||||
return !isAnnotationClassPrimaryConstructor()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user