-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSpecify: support generic methods #1035
Labels
jspecify
Related to support for jspecify standard (see jspecify.dev)
Comments
Hi @beatbrot thanks for the report. We currently have no support for generic methods in JSpecify mode, only generic classes. See further details here: https:/uber/NullAway/wiki/JSpecify-Support We are actively working on this and hope to have more support within the next few months. I will update this issue when something is implemented. |
msridhar
added
the
jspecify
Related to support for jspecify standard (see jspecify.dev)
label
Sep 9, 2024
msridhar
changed the title
JSpecify Nullable annotations are not respected for Generic Type Parameters
JSpecify: support generic methods
Sep 9, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
According to the JSpecify Spec, it is possible to add
extends @Nullable Object
to type parameters to siginify thatT
can be a nullable type.Consider the following sample:
According to JSpecify Spec, this is valid since the call to
foo
inmain
explicitly specifies the type parameterT
as nullable Object. The JSpecify Reference Checker also accepts this.NullAway however falsly gives us the following error without JSpecifyMode:
And this error with JSpecifyMode:
This issue seems similar to #660 and others, but I feel like my example gives a proper way to verify that this is a Bug and that the Bug would be resolved if my sample compiles.
The text was updated successfully, but these errors were encountered: