RFR: Fixing completion detection for null-restricted variables and fixing behavior for incorrect null-restricted variables without an initializer.

Jan Lahoda jlahoda at openjdk.org
Mon Jan 19 15:50:25 UTC 2026


Fixing behavior in two cases:
- `String! str = ""` (i.e. missing semicolon) should work. This is achieved by fixing the completion analysis to report the snippet as `COMPLETE_WITH_SEMI`.
- `String! str` (i.e. missing initializer). This should produce an error saying initializer is required, achieved by not using the null initializer in this case.

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

Commit messages:
 - Adding more tests.
 - Fixing completion detection for null-restricted variables and fixing behavior for incorrect null-restricted variables without an initializer.

Changes: https://git.openjdk.org/valhalla/pull/1932/files
  Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=1932&range=00
  Stats: 51 lines in 5 files changed: 44 ins; 0 del; 7 mod
  Patch: https://git.openjdk.org/valhalla/pull/1932.diff
  Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1932/head:pull/1932

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


More information about the valhalla-dev mailing list