RFR: generate null checks for intersections for which at least one component is null restricted
Vicente Romero
vromero at openjdk.org
Mon Jan 12 17:35:24 UTC 2026
On Fri, 9 Jan 2026 23:35:35 GMT, Vicente Romero <vromero at openjdk.org> wrote:
> javac should generate a null check for code like:
>
>
> class Test {
> public static void main(String... args) {
> Object s = null;
> Object o = (String & Runnable!) s; // NPE, cast
> }
> }
>
> the idea of the fix is to consider an intersection null restricted if at least one of its components is null restricted
thanks for the review
-------------
PR Comment: https://git.openjdk.org/valhalla/pull/1881#issuecomment-3739691074
More information about the valhalla-dev
mailing list