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.