On Mon, 26 Jan 2026 15:59:29 GMT, Vicente Romero <[email protected]> wrote:

> Javac is generating erroneous null checks for code like, test case provided 
> by Jan:
> 
> 
> public class Main {
>     public String g() {
>         return Other.str = "";
>     }
> }
> class Other {
>     public static String! str = "";
> }
> 
> so there is no point in generating null checks on the left side of an 
> assignment statement. So the proposal is to use a switch to indicate when 
> null checks shouldn't be generated.
> 
> TIA

updated the PR with Jan's proposal

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

PR Comment: https://git.openjdk.org/valhalla/pull/1972#issuecomment-3800549005

Reply via email to