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 :-)

Cheers,
Andres

-------------------------------------------
Java Champion; Groovy Enthusiast
http://jroller.com/aalmiray
http://www.linkedin.com/in/aalmiray
--
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 <realbluesun@hotmail.com> 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
Java.

       Any thoughts?

Cheers,
Daniel.Sun



--
View this message in context: http://groovy.329449.n5.nabble.com/About-array-initializer-of-Java-style-for-Groovy-3-tp5737941.html
Sent from the Groovy Dev mailing list archive at Nabble.com.