Repository navigation
Conversation
Collaborator
Author
|
This change is part of the following stack: Change managed by git-spice. |
This was referenced Aug 24, 2026
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1739 +/- ##
============================================
- Coverage 87.68% 87.61% -0.08%
- Complexity 3524 3536 +12
============================================
Files 110 110
Lines 11738 11769 +31
Branches 2425 2435 +10
============================================
+ Hits 10293 10311 +18
- Misses 662 671 +9
- Partials 783 787 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
msridhar
force-pushed
the
more-nested-nullness-override-checks
branch
7 times, most recently
from
August 29, 2026 20:48
326ff97 to
4a15623
Compare
msridhar
force-pushed
the
more-nested-nullness-override-checks
branch
2 times, most recently
from
September 9, 2026 21:33
5bdd31d to
39c5b34
Compare
msridhar
force-pushed
the
more-nested-nullness-override-checks
branch
from
September 17, 2026 23:55
39c5b34 to
dfe8279
Compare
Assisted-by: Codex (gpt-6)
Assisted-by: Codex (gpt-6)
msridhar
force-pushed
the
more-nested-nullness-override-checks
branch
from
October 4, 2026 22:54
dfe8279 to
d9b2857
Compare
This was referenced Oct 4, 2026
msridhar
added a commit
that referenced
this pull request
Oct 7, 2026
Fixes #1919 This issue came up while working on #1739. For cases like the test of #1919, we would sometimes fall back on the `javac`-computed type of an implicitly-typed lambda parameter. E.g., for this code (from #1919): ```java static void implicitParameter(Box<Box<@nullable String>> nested) { var flat = nested.flatMap(box -> box); acceptsNullable(flat); } ``` The type of `box` should be `Box<@nullable String>` based on the declaration of `nested`, but `javac` computes it as `Box<String>`, causing a spurious warning. To fix, store correct types of such parameters in a new map `lambdaParameterTypesForInference` during inference for the lambda body, and lookup types in that map as appropriate. We need to carefully update and restore this map to handle nested lambdas and to not "leak" these types to other parts of inference (since the types may have references to unresolved type variables). (The alternative would have been to thread these types as a parameter through many methods, but that would have been a more disruptive change.) To handle lambdas like `box -> { var copy = box; return copy; }`, we also update our visitor to discover return statements to also discover and register `var`-declared locals. We disable caching of inferred types whenever `lambdaParameterTypesForInference` is non-empty to be conservative. The new tests exercise a number of cases around expression lambdas vs statement lambdas and nested lambdas. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary * **Bug Fixes** * Improved nullness inference for implicit lambda parameters in nested generic calls, local variables, and expression- or block-bodied lambdas. * Preserved nullable-dereference diagnostics when generic method calls appear in lambda-local variable initializers, keeping potentially unsafe dereferences visible. * Improved recognition of nested nullable types across lambda-body calls and local assignments, including cases where inferred types are used in subsequent generic operations. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
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.
This closes an important gap in checking, but it causes new errors, and we have other high-priority issues to fix, so going to hold off on landing for a bit