Groovy
  1. Groovy
  2. GROOVY-5207

@Field access within closure fails with 'BUG! exception in phase 'class generation' in source unit'

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.4
    • Fix Version/s: 1.8.6, 2.0-beta-3
    • Component/s: None
    • Labels:
      None

      Description

      Looks like accessing @Field fields inside closures has a problem. Please file a bug.

      ---------------------------------------------
      import groovy.transform.Field

      @Field pomProperties = [:]

      "".each {
      pomProperties[1] = 2
      }
      ---------------------------------------------
      fails with the same error.
      ---------------------------------------------
      Caught: BUG! exception in phase 'class generation' in source unit 'C:\Temp\m2g.groovy' tried to get a variable with the name pomProperties
      as stack variable, but a variable with this name was not created
      ---------------------------------------------

      1. groovy5207.patch
        41 kB
        Paul King
      2. groovy5207B.patch
        2 kB
        Paul King

        Activity

        Ray Suliteanu created issue -
        Paul King made changes -
        Field Original Value New Value
        Attachment groovy5207.patch [ 58460 ]
        Paul King made changes -
        Attachment groovy5207B.patch [ 58461 ]
        Paul King made changes -
        Assignee Paul King [ paulk ]
        Resolution Fixed [ 1 ]
        Fix Version/s 2.0-beta-3 [ 18244 ]
        Fix Version/s 1.8.6 [ 18245 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Paul King made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Mark Thomas made changes -
        Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
        Mark Thomas made changes -
        Workflow jira [ 12734131 ] Default workflow, editable Closed status [ 12745577 ]
        Mark Thomas made changes -
        Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
        Mark Thomas made changes -
        Workflow jira [ 12971305 ] Default workflow, editable Closed status [ 12979088 ]

          People

          • Assignee:
            Paul King
            Reporter:
            Ray Suliteanu
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development