Inspectopedia Help

Unnecessary parentheses in function call with lambda

Reports redundant empty parentheses of function calls where the only parameter is a lambda that's outside the parentheses.

Use the 'Remove unnecessary parentheses from function call with lambda' quick-fix to clean up the code.

Examples:

fun foo() { listOf(1).forEach() { } }

After the quick-fix is applied:

fun foo() { listOf(1).forEach { } }

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3

Plugin:

Kotlin, @snapshot@

Last modified: 13 July 2023