Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-2130

Use of java iterators in for loop is syntax error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.1-beta-2
    • 1.1-rc-1
    • None

    Description

      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

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            deaddowney Adam krieg
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: