Back to Intellij Community

ScopeFunctionConversion

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

2025.3-rc-2348 B
Original Source

Reports scope functions (let, run, apply, also) that can be converted between each other.

Using corresponding functions makes your code simpler.

The quick-fix replaces the scope function to another one.

Example:

val x = "".let {
      it.length
  }

After the quick-fix is applied:

val x = "".run {
      length
  }