Why is Intellij suggesting I make a private field private? Am I not understanding this correctly or is it just a bug? I have posted a picture of the error and the decompiled class below. Is this something I should heed or ignore?
CodePudding user response:
It is a suggestion about the property, not the field. In Java side a property is essentially a field and its accessor methods.
If you changed val s
to private val s
, the decompiled class would have private
visibility for the getS()
accessor rather than public
.