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
/tmp/Test.java:8: error: [methodref.param] Incompatible parameter type for o
A<@Nullable Object> p = Test::foo;
^
found : @Initialized @NonNull Object
required: @Initialized @Nullable Object
Consequence: method in @Initialized @NonNull Test
@Initialized @NonNull String foo(@Initialized @NonNull Object p0)
is not a valid method reference for method in @UnknownInitialization @Nullable A<@Initialized @Nullable Object>
@Initialized @NonNull String fn(@Initialized @NonNull A<@Initialized @Nullable Object> this, @Initialized @Nullable Object p0)
1 error
In a couple of places the error message refers to p0 which is not the name of any variable in the program.
I also find the error message somewhat hard to read with all the (irrelevant) initializer annotations, but perhaps that is a separate issue.
The text was updated successfully, but these errors were encountered:
msridhar
changed the title
Nullness Checker error uses incorrect parameter name
Nullness Checker error message uses incorrect parameter name
Oct 13, 2023
// Output some parameter names to make it look more like a method.
// TODO: go to the element and look up real parameter names, maybe.
There will still be cases where the parameter name is not in the element, but the parameter names for your test case will be there since they are from source.
I also find the error message somewhat hard to read with all the (irrelevant) initializer annotations, but perhaps that is a separate issue.
We have an issue for this: #2276. It's not actually too hard to fix, we just haven't done it.
Test case:
Error output from the Nullness Checker:
In a couple of places the error message refers to
p0
which is not the name of any variable in the program.I also find the error message somewhat hard to read with all the (irrelevant) initializer annotations, but perhaps that is a separate issue.
The text was updated successfully, but these errors were encountered: