-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding support for nullable type upper bounds considering Library mod…
…els (#903) 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. ```java Function<String,@nullable String> removeA = a -> a.replace("a",""); ``` We now have library model methods for treating a type as `@NullMarked` and also for making the upper bound of type variables `@Nullable`. We use these new methods to model `java.util.function.Function` as `@NullMarked`, in JSpecify mode only. We fix a related issue with unwanted errors when passing a lambda / method reference to `@NullUnmarked` code; 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) --------- Co-authored-by: Manu Sridharan <[email protected]>
- Loading branch information
Showing
13 changed files
with
332 additions
and
47 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.