-
Notifications
You must be signed in to change notification settings - Fork 288
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
Add JSpecify checking for return statements #734
Add JSpecify checking for return statements #734
Conversation
Co-authored-by: Manu Sridharan <msridhar@gmail.com>
@lazaroclapp I already did a few passes on this one. It'd be great if you could take a look, when you have time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor nits/suggestions below, but overall this looks good!
nullaway/src/test/java/com/uber/nullaway/NullAwayJSpecifyGenericsTests.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One incredibly minor nit left from me. Good to land once that's addressed 🙂
@@ -151,8 +151,10 @@ private static void reportInvalidReturnTypeError( | |||
} | |||
|
|||
/** | |||
* This method returns type of the tree considering that the parameterized typed tree annotations | |||
* are not preserved if obtained directly using ASTHelpers. | |||
* This method returns the type of the tree, including any type use annotations. This is required |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would still introduce a paragraph break after the first line here. Since the first line is a description of what the method does and the rest is additional explanation. It might need a <p>
at the beginning of the new paragraph in order for GJF to not reformat it...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in f000611
nullaway/src/test/java/com/uber/nullaway/NullAwayJSpecifyGenericsTests.java
Outdated
Show resolved
Hide resolved
This reverts commit 1548c69.
This reverts commit 1548c69.
This reverts commit 1548c69.
This reverts commit 1548c69.
This reverts commit 1548c69.
This pull request includes the following:
static A<@Nullable String> test() { return new A<String>(); }
For the method return type, the type parameter is @nullable String and the type of the type parameter of the actual return statement is NonNull. NullAway will report an error here.