Repository: groovy
Updated Branches:
  refs/heads/master 9e21d7566 -> 96b7e57f7


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/96b7e57f
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/96b7e57f
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/96b7e57f

Branch: refs/heads/master
Commit: 96b7e57f7d3b680a604e4174d759011cd5c80e98
Parents: 9e21d75
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:29:08 2017 -0700

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


http://git-wip-us.apache.org/repos/asf/groovy/blob/96b7e57f/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