On Fri, 6 Feb 2026 00:23:01 GMT, Vicente Romero <[email protected]> wrote:
> emit a lint warning for cases like:
>
> class Test {
> String! m(String s) { return ""; }
> }
> class Sub extends Test {
> @Override
> String m(String s) { return null; }
> }
>
> or:
>
> class Test {
> String m(String! s) { return ""; }
> }
> class Sub extends Test {
> @Override
> String m(String s) { return null; }
> }
test/langtools/tools/javac/nullability/NullabilityCompilationTests.java line
319:
> 317: class Sub extends Test {
> 318: @Override
> 319: String m(String s) { return null; }
I think this should be no-warning, instead we should emit warning if Test.m
does not have ! but Sub.m has, meaning test.m(null) call will fail on Sub.
-------------
PR Review Comment:
https://git.openjdk.org/valhalla/pull/2058#discussion_r2771741078