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

for loop variable is not correctly passed into inner closure

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.0-beta-4
    • None
    • None

    Description

      The following fails, as the variable declared by a for loop isn't passed into a closure

      list = ['a']
      for (x in [0, 1]) {
      list.each

      { assert x != null }

      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            jstrachan James Strachan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: