You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Better support lambda parameters in generic method inference #1290
error: [NullAway] Cannot pass parameter of type Supplier<Object>, as formal parameter has type Supplier<@org.jspecify.annotations.Nullable R>, which has mismatched type parameter nullability
invoke(() -> null);
^
In NullAway 0.12.13 our support for non-void lambda parameters that return should be improved. And, we already shipped better support for void lambda parameters in an earlier release. The case we're still working on is #1350 which relates to wildcards. This is the issue related to calls to Reactor's mapNotNull method. If you notice other problems related to lambdas and generic method inference please let us know or open a new issue.
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler output below.
/home/mhalbritter/Downloads/nullaway-reproducer/src/main/java/com/example/nullaway_reproducer/XX.java:12: error: [NullAway] Failed to infer type argument nullability for call invoke(XX::returnsNull): Cannot treat @Nullable type as @NonNull: @org.jspecify.annotations.Nullable R
invoke(XX::returnsNull);
^
(see http://t.uber.com/nullaway )
2 errors
Activity
msridhar commentedon Dec 1, 2025
In NullAway 0.12.13 our support for non-void lambda parameters that return should be improved. And, we already shipped better support for void lambda parameters in an earlier release. The case we're still working on is #1350 which relates to wildcards. This is the issue related to calls to Reactor's
mapNotNullmethod. If you notice other problems related to lambdas and generic method inference please let us know or open a new issue.sdeleuze commentedon Jan 6, 2026
@mhalbritter Could you please check if your use case with
Supplier<@Nullable R> supplieris fixed, and let us know?mhalbritter commentedon Jan 7, 2026
NullAway 0.12.15:
compiles, so the original issue I reported is fixed.
However,
fooininvokecould benull, so thefoo.toString()should fail to compile, but it doesn't. Maybe a different issue?mhalbritter commentedon Jan 7, 2026
When combined with method references, it doesn't compile:
error:
msridhar commentedon Jan 7, 2026
Thanks, @mhalbritter, the method reference issue is #1128 / #1307. I'm actively working on it.
Add regression tests for cast map reads and nullable Supplier type ar…