Inspectopedia Help

Redundant creation of lambda or anonymous function

Reports lambdas or anonymous functions that are created and used immediately.

fun test() { ({ println() })() // redundant (fun() { println() })() // redundant }

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3

Plugin:

Kotlin, @snapshot@

Last modified: 13 July 2023