On Tue, 10 Feb 2026 01:06:16 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; }
>> }
>
> Vicente Romero has updated the pull request incrementally with one additional
> commit since the last revision:
>
> doc changes
src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java line 4009:
> 4007: if (!types.isSameTypes(argTypes, lambdaTypes)) {
> 4008: checkContext.report(tree,
> diags.fragment(Fragments.IncompatibleArgTypesInLambda));
> 4009: } else if (allowNullRestrictedTypes) {
I think we should the same with method references
-------------
PR Review Comment:
https://git.openjdk.org/valhalla/pull/2058#discussion_r2785632156