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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: 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
      ---------------------------------------------

        Attachments

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

          Activity

            People

            • Assignee:
              paulk Paul King
              Reporter:
              ray@suliteanu.com Ray Suliteanu
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: