RFR: More parser fixes for null restricted types [v3]

Maurizio Cimadamore mcimadamore at openjdk.org
Thu Jan 8 15:17:36 UTC 2026


> This PR fixes a number of leftover issues in the parser:
> * sometimes the parser accepts `!` before the type arguments of a generic type
> * null restrictions parsed as part of the array type in an array creation expression are dropped on the floor
> * null restrictions appearing (erroneously) before an array initializer causes spurious parser errors, as parsers doesn't take bangs into account
> * null restriction in method reference type qualifier leads to spurious errors
> * null restriction in inner class creation expressions leads to spurious errors

Maurizio Cimadamore has updated the pull request incrementally with one additional commit since the last revision:

  Fix issue with inner class creation

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

Changes:
  - all: https://git.openjdk.org/valhalla/pull/1868/files
  - new: https://git.openjdk.org/valhalla/pull/1868/files/f56d1193..1b4f0326

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=valhalla&pr=1868&range=02
 - incr: https://webrevs.openjdk.org/?repo=valhalla&pr=1868&range=01-02

  Stats: 37 lines in 3 files changed: 32 ins; 1 del; 4 mod
  Patch: https://git.openjdk.org/valhalla/pull/1868.diff
  Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1868/head:pull/1868

PR: https://git.openjdk.org/valhalla/pull/1868


More information about the valhalla-dev mailing list