Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_4_X c2ac65ecc -> 875dd933f


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

Branch: refs/heads/GROOVY_2_4_X
Commit: 875dd933f1b40fb4d71e6ca5644932d9af9e8c33
Parents: c2ac65e
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:33:47 2017 -0700

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


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