Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_5_X cae65cb98 -> f7fbdb237


GROOVY-8208: VariableExpressionTransformer does not set source position on 
property expressions (closes #581)


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/f7fbdb23
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/f7fbdb23
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/f7fbdb23

Branch: refs/heads/GROOVY_2_5_X
Commit: f7fbdb2375fd6e5220e4bd82e249939af8d0e3a4
Parents: cae65cb
Author: John Wagenleitner <jwagenleit...@apache.org>
Authored: Sat Aug 12 21:43:06 2017 -0700
Committer: John Wagenleitner <jwagenleit...@apache.org>
Committed: Sat Aug 12 22:32:44 2017 -0700

----------------------------------------------------------------------
 .../transform/sc/transformers/VariableExpressionTransformer.java   | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/f7fbdb23/src/main/org/codehaus/groovy/transform/sc/transformers/VariableExpressionTransformer.java
----------------------------------------------------------------------
diff --git 
a/src/main/org/codehaus/groovy/transform/sc/transformers/VariableExpressionTransformer.java
 
b/src/main/org/codehaus/groovy/transform/sc/transformers/VariableExpressionTransformer.java
index a613147..d055fc6 100644
--- 
a/src/main/org/codehaus/groovy/transform/sc/transformers/VariableExpressionTransformer.java
+++ 
b/src/main/org/codehaus/groovy/transform/sc/transformers/VariableExpressionTransformer.java
@@ -56,6 +56,7 @@ public class VariableExpressionTransformer {
         PropertyExpression pexp = new PropertyExpression(implicitThis, 
expr.getName());
         pexp.copyNodeMetaData(expr);
         pexp.setImplicitThis(true);
+        pexp.getProperty().setSourcePosition(expr);
         ClassNode owner = 
expr.getNodeMetaData(StaticCompilationMetadataKeys.PROPERTY_OWNER);
         if (owner != null) {
             implicitThis.putNodeMetaData(StaticTypesMarker.INFERRED_TYPE, 
owner);
@@ -78,6 +79,7 @@ public class VariableExpressionTransformer {
                     expr.getName()
             );
             pexp.setImplicitThis(true);
+            pexp.getProperty().setSourcePosition(expr);
             // put the receiver inferred type so that the class writer knows 
that it will have to call a bridge method
             receiver.putNodeMetaData(StaticTypesMarker.INFERRED_TYPE, 
field.getDeclaringClass());
             // add inferred type information

Reply via email to