protected
visibility in final
class KT-W1055Kotlin classes are final
by default. Thus, classes which are not marked as open
should not contain protected
members.
If stricter visibility is desired, one should consider making the members private
. On the other hand, if the member is
a const
property and visibility outside the class is not an issue, consider making it public
.
class ProtectedMemberInFinalClass {
protected var i = 0
}
Consider using private
, internal
, or public
modifiers instead.
class ProtectedMemberInFinalClass {
private var i = 0
}