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

Cannot set outside variables from within nested closures

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-JSR-2
    • 1.0-JSR-5
    • class generator
    • None
    • HEAD

    Description

      You cannot set variables more than one closure aware from their scope:

      def t = 2;
      [1].each {
      [1].each

      { t = 1; }

      }
      println t;

      This currently prints 0.

      Attachments

        Issue Links

          Activity

            People

              blackdrag Jochen Theodorou
              spullara Sam Pullara
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: