Can this feature be added without the parser getting confused with {1, 2, 3}, thinking it's a closure instead of an initializer?
AFAIK this is the same reason why instance initializers are not supported by Groovy.

If it can be done then great! This would remove one gotcha when migratation Java code to Groovy :-)


Java Champion; Groovy Enthusiast
What goes up, must come down. Ask any system administrator.
There are 10 types of people in the world: Those who understand binary, and those who don't.
To understand recursion, we must first understand recursion.

On Tue, Jan 24, 2017 at 8:14 AM, Daniel Sun <> wrote:
Hi all,

       Java supports specifing initial values while creating arrays, e.g.
`new int[] {1, 2, 3}`, `new String[] { hello(), world() }`, etc. I plan to
add this syntax for Groovy 3 to improve the compatibility between Groovy and

       Any thoughts?


View this message in context:
Sent from the Groovy Dev mailing list archive at