Issue Details (XML | Word | Printable)

Key: GROOVY-2130
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Jochen Theodorou
Reporter: Adam Krieg
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
groovy

Use of java iterators in for loop is syntax error

Created: 20/Sep/07 03:02 PM   Updated: 11/Oct/07 06:46 PM   Resolved: 11/Oct/07 06:46 PM
Return to search
Component/s: command line processing
Affects Version/s: 1.1-beta-2
Fix Version/s: 1.1-rc-1

Time Tracking:
Not Specified


 Description  « Hide

Java supports the use of iterators like so:

for (Iterator i = list.iterator();i.hasNext(){

The above in Groovy causes a compilation error:

unexpected token: )
= list.iterator();i.hasNext(){

but does support with an extra semicolon

for (Iterator i = list.iterator();i.hasNext();

Groovy should support the java syntax



Jochen Theodorou added a comment - 11/Oct/07 06:46 PM

fixed