Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.1.5, 2.4.0-rc-1
-
None
Description
Evaluating
(1..3)[*0..2]
throws: BUG! exception in phase 'class generation' in source unit 'ConsoleScript42' SpreadExpression should not be visited here
It works fine if I manually call getAt:
(1..3).getAt([*0..2]) // [1, 2, 3]
It also works if I add something besides the spread:
(1..3)[*0..2, 2] // [1, 2, 3, 3]
as shown in the Ranges and List-Slicing section of Getting Started Guide > Collections.
There are other SpreadExpression BUG!s, but I'm not sure if this bug is the same:
http://jira.codehaus.org/issues/?jql=text%20%7E%20%22SpreadExpression%22
Attachments
Issue Links
- relates to
-
GROOVY-7446 setting list values via slicing not working with @TypeChecked
- Open