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
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
- relates to
-
JDK-8329951 `var` emits deprecation warnings that do not point to the file or position
-
- Resolved
-