Back to Intellij Community

ExplicitThis

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

2025.3-rc-2244 B
Original Source

Reports an explicit this when it can be omitted.

Example:

class C {
      private val i = 1
      fun f() = this.i
  }

The quick-fix removes the redundant this:

class C {
      private val i = 1
      fun f() = i
  }