Back to Intellij Community

LateinitVarOverridesLateinitVar

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

2025.3-rc-2382 B
Original Source

Reports lateinit var properties that override other lateinit var properties.

A subclass instance will have two fields for a single property, and the one from the superclass will remain effectively unused.

Example:

open class BaseClass {
      open lateinit var name: String
    }

    class RealClass : BaseClass() {
      override lateinit var name: String
    }