Skip to content

Files

Latest commit

 

History

History
21 lines (13 loc) · 518 Bytes

ClosureAsLastMethodParameter.md

File metadata and controls

21 lines (13 loc) · 518 Bytes

Pattern: Closure as last method parameter

Issue: -

Description

If a method is called and the last parameter is an inline closure then it can be declared outside of the method call parentheses.

Example of violations:

// creates violation: poor Groovy style
[1,2,3].each({ println it })

// no violation
[1,2,3].each { println it }

Further Reading