Back to Intellij Community

UnusedLambdaExpression

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

2025.3-rc-2411 B
Original Source

Reports lambda expressions that are neither invoked nor assigned.

A lambda expression that is neither invoked nor assigned to a variable has no effect on program execution and is likely unintentional.

Example:

fun foo() {
    {} // Warning: Lambda expression is never invoked
  }

After the quick fix is applied:

fun foo() {
    run {} // Lambda is now invoked via the 'run' function
  }