Quantcast

[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
|  
Report Content as Inappropriate

[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=16017834#comment-16017834 ]

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

GitHub user ArsenBabakhanyan opened a pull request:

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

    GROOVY-8193: setting sourcePosition on Property Expression

   

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ArsenBabakhanyan/groovy GROOVY-8193

Alternatively you can review and apply these changes as the patch at:

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

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #542
   
----
commit cc750bf27917f04ae5f3de872fa0d42c8050d10e
Author: Arsen Babakhanyan <[hidden email]>
Date:   2017-05-19T18:46:39Z

    GROOVY-8193: setting sourcePosition on Property Expression

----


> 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)
Loading...