On Thu, 15 Jan 2026 05:46:52 GMT, Vicente Romero <[email protected]> wrote:
> Adding use site null checks for method invocations. They are added by default
> but if option: `noUseSiteNullChecks` is passed, the compiler won't generate
> them
src/jdk.compiler/share/classes/com/sun/tools/javac/comp/NullChecksWriter.java
line 204:
> 202: }
> 203: Type formalArgType = declaredArgTypes.head;
> 204: if (msym.isVarArgs() && formalArgType == varArgsArg) {
I think this check can misfire. Some types are shared -- e.g. syms.stringType,
so you might get `==` in "wrong" places. That said, here `varArgsArg` is an
array type, and for that we might always get a fresh instance... so it might
work.
It also looks like there might be a potential problem here -- this code runs
_after_ varargs translation has occurred. Meaning that for varargs, we only see
a javac-created array and we can check the variadic elements.
But again, the plan here would be to disallow `C!...` so this is ok.
-------------
PR Review Comment:
https://git.openjdk.org/valhalla/pull/1910#discussion_r2693697618