Back to Intellij Community

ProtectedInFinal

plugins/kotlin/code-insight/descriptions/resources-en/inspectionDescriptions/ProtectedInFinal.html

2025.3-rc-2339 B
Original Source

Reports protected visibility used inside of a final class. In such cases protected members are accessible only in the class itself, so they are effectively private.

Example:

class FinalClass {
      protected fun foo() {}
  }

After the quick-fix is applied:

class FinalClass {
      private fun foo() {}
  }