Inspectopedia Help

'return' statement can be implicit

Reports return statements at the end of closures which can be made implicit.

Groovy closures implicitly return the value of the last statement in them.

Example:

def foo = { return 1 }

After the quick-fix is applied:

def foo = { 1 }

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3

Plugin:

Groovy, 233.SNAPSHOT

Last modified: 13 July 2023