Back to Intellij Community

RemoveEmptyParenthesesFromLambdaCall

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

2025.3-rc-2383 B
Original Source

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 { }
  }