[jira] [Commented] (GROOVY-8193) TraitReceiverTransformer does not set source position on property expressions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (GROOVY-8193) TraitReceiverTransformer does not set source position on property expressions

JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/GROOVY-8193?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16018498#comment-16018498 ]

ASF GitHub Bot commented on GROOVY-8193:
----------------------------------------

Github user asfgit closed the pull request at:

    https://github.com/apache/groovy/pull/542


> TraitReceiverTransformer does not set source position on property expressions
> -----------------------------------------------------------------------------
>
>                 Key: GROOVY-8193
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8193
>             Project: Groovy
>          Issue Type: Bug
>          Components: xforms
>            Reporter: Eric Milles
>            Priority: Minor
>
> Two paths in TraitReceiverTransformer.transform create PropertyExpression nodes to stand in for unresolved variable references.  Neither case sets the exp source position onto the new node.  Other paths through this method transfer position info.
> The fix is simple: {code}
>             } else if (accessedVariable instanceof PropertyNode) {
>                 String propName = accessedVariable.getName();
>                 if (knownFields.contains(propName)) {
>                     return createFieldHelperCall(exp, weavedType, propName);
>                 } else {
>                     // GRECLIPSE edit
>                     PropertyExpression pe =
>                     /*return*/ new PropertyExpression(
>                             new VariableExpression(weaved),
>                             accessedVariable.getName()
>                     );
>                     pe.getProperty().setSourcePosition(exp);
>                     return pe;
>                     // GRECLIPSE end
>                 }
>             } else if (accessedVariable instanceof DynamicVariable) {
>                 // GRECLIPSE edit
>                 PropertyExpression pe =
>                 /*return*/ new PropertyExpression(
>                         new VariableExpression(weaved),
>                         accessedVariable.getName()
>                 );
>                 pe.getProperty().setSourcePosition(exp);
>                 return pe;
>                 // GRECLIPSE end
>             }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)