Adding support for nullable type upper bounds considering Library models#903
Merged
msridhar merged 8 commits intouber:masterfrom Feb 9, 2024
Merged
Conversation
msridhar
reviewed
Feb 2, 2024
Collaborator
msridhar
left a comment
There was a problem hiding this comment.
Another issue, see below
nullaway/src/test/java/com/uber/nullaway/NullAwayJSpecifyGenericsTests.java
Show resolved
Hide resolved
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #903 +/- ##
============================================
+ Coverage 86.98% 87.05% +0.07%
- Complexity 1959 1988 +29
============================================
Files 77 77
Lines 6330 6414 +84
Branches 1223 1245 +22
============================================
+ Hits 5506 5584 +78
- Misses 420 422 +2
- Partials 404 408 +4 ☔ View full report in Codecov by Sentry. |
msridhar
approved these changes
Feb 4, 2024
Collaborator
|
Going ahead and merging this one. Thanks again @akulk022! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The below line previously reported an error considering the upperbound of the generic type parameter couldn't be Nullable, adding it into library models to allow it to be Nullable passes the test case.
We now have library model methods for treating a type as
@NullMarkedand also for making the upper bound of type variables@Nullable. We use these new methods to modeljava.util.function.Functionas@NullMarked, in JSpecify mode only.We fixed a related issue with unwanted errors when passing a lambda / method reference to
@NullUnmarkedcode; this was necessary to get NullAway itself to still build with NullAway checking enabled.(Due to issues with the branch this PR was recreated from the original #893)