[
https://issues.apache.org/jira/browse/GROOVY-8193?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
John Wagenleitner resolved GROOVY-8193.
---------------------------------------
Resolution: Fixed
Assignee: John Wagenleitner
Fix Version/s: 2.4.12
PR from Arsen Babakhanyan merged, thanks for reporting the issue.
> 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
> Assignee: John Wagenleitner
> Priority: Minor
> Fix For: 2.4.12
>
>
> 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)