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

VariableScope node contains only formal parameters, lacks local variable information

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 1.0
    • 1.0
    • parser
    • None
    • Java 1.5

    Description

      When we retrieve the VariableScope object from a parsed groovy script (actually from the MethodNode in the script) we find that the VariableScope object only contains variable information for the formally declared parameters of the method. It lacks any other variable information, even for explicitly typed local variables. In other words, the collections declaredVariables only contains the parameters, and both referencedLocalVariables and referencedClassVariables are empty. For example, the method:

      public String GetSomething( TypeA p1, TypeB p2) {
      TypeC v1
      }

      Will contain entries in the declaredVariables collection for p1 and p2, but will not contain anything for v1.

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            dklebanoff David Klebanoff
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: