Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
Description
There are a few cases where bare array initializers are not yet supported:
- int[][] array = { {1,2}, {3,4} };
- @Target({ ElementType.FIELD, ElementType.METHOD })
@interface A { String[] strings() default {} }
These were implemented as part of [1] but the PR was closed. It may be worth looking back over what was done and re-implementing one or more of these cases. It was noted that Closure[] array = {}; is one of the edge cases that leads to ambiguity.
Attachments
Issue Links
- is related to
-
GROOVY-1588 Better error messages when using Java's array init syntax
- Closed
-
GROOVY-3791 [PARROT] Support Java Array initializer syntax when not ambiguous
- Closed
-
GROOVY-8561 Support java-like array
- Closed
-
GROOVY-8551 Java compatibility: support multi-dimensional array initializers
- Closed
-
GROOVY-8566 Array initialization from list literal without "as" should be supported under static compilation for multi-dimension arrays
- Closed