-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JSpecify: handle Nullability for lambda expression parameters for Gen…
…eric Types (#852) We were not getting the desired error for the positive test in the following test case: ```java class Test { interface A<T1 extends @nullable Object> { String function(T1 o); } static void testPositive() { // We were not getting the desired error here and these changes address that // BUG: Diagnostic contains: dereferenced expression o is @nullable A<@nullable Object> p = o -> o.toString(); } static void testNegative() { A<Object> p = o -> o.toString(); } } ``` Upon changing the way we compute the Nullability of the functional interface parameters, we are able to get the desired error. Note: These changes only affect lambda parameters and do not deal with return types. That will be addressed in a future PR. --------- Co-authored-by: Manu Sridharan <msridhar@gmail.com>
- Loading branch information
Showing
2 changed files
with
68 additions
and
5 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