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

Allow for-each iteration without types

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1-beta-2
    • 1.5
    • None
    • None

    Description

      I would like to write

      for (v : collection) {
      System.out.println(v);
      }

      However, Groovy complains when I do this
      Java-style for-each statement requires a type declaration

      It seems to me that there's no reason to require this restriction, granting that there are probably more natural Groovy idioms for doing this kind of thing.

      Attachments

        Activity

          People

            Unassigned Unassigned
            rbodkin Ron Bodkin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: