Trees for `var` do not have end positions

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • 27
    • Affects Version/s: 25
    • Component/s: tools
    • None

      When trees for inferred local variable types are synthesized, the nodes are given a start position but not an end position: https://github.com/archiecobbs/jdk/blob/151d9882befe4424aa0b5856a3d17855b5c6ae41/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java#L5717

      The end positions can be retrieved using com.sun.source.util.SourcePositions#getEndPosition (e.g. by javac plugins), and end positions are available for explicitly typed local variables, so it would be helpful if these synthetic types also recorded an end position for consistency.

      See also discussion in https://github.com/openjdk/jdk/pull/23683

            Assignee:
            Angelos Bimpoudis
            Reporter:
            Liam Miller-Cushon
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: