RFR: 8359383: Incorrect starting positions for implicitly typed variables

Archie Cobbs acobbs at openjdk.org
Thu Jun 12 19:50:03 UTC 2025


This fixes starting position bugs relating to implicitly typed variables; see the linked issue for details.

This also makes it possible to recover the declaration type (explicit, implicit, or `var`) from a `JCVariableDecl` and, in the case of `var` declarations, the starting position of the `var`; previously this wasn't possible.

Finally, as a minor drive-by improvement, we can now pretty print `var` as `var` instead of `/*missing*/`.

-------------

Commit messages:
 - Fix various starting position bugs relating to implicitly typed variables.

Changes: https://git.openjdk.org/jdk/pull/25786/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25786&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8359383
  Stats: 151 lines in 12 files changed: 91 ins; 10 del; 50 mod
  Patch: https://git.openjdk.org/jdk/pull/25786.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25786/head:pull/25786

PR: https://git.openjdk.org/jdk/pull/25786


More information about the compiler-dev mailing list