RFR: Support for null-restricted types in JShell

Jan Lahoda jlahoda at openjdk.org
Fri Jan 16 15:51:33 UTC 2026


Base on mcimadamore's idea of desugaring like:

String! str = init;
=>
class JShellClass {
    public static class Holder {
        public static String! str = init;
    }
    static Object do_it$() {
        return Holder.str;
    }
}

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

Commit messages:
 - Adding tests.
 - Support for JShell, as suggested by mcimadamore.

Changes: https://git.openjdk.org/valhalla/pull/1925/files
  Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=1925&range=00
  Stats: 117 lines in 5 files changed: 73 ins; 23 del; 21 mod
  Patch: https://git.openjdk.org/valhalla/pull/1925.diff
  Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1925/head:pull/1925

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


More information about the valhalla-dev mailing list