Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-8193

TraitReceiverTransformer does not set source position on property expressions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.4.12
    • xforms
    • None

    Description

      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:

                  } 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
                  }
      

      Attachments

        Issue Links

          Activity

            People

              jwagenleitner John Wagenleitner
              emilles Eric Milles
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: