Repository navigation
Generics checks for method overriding - #755
Merged
Merged
Conversation
msridhar
force-pushed
the
try-method-match
branch
from
March 31, 2023 22:15
88e5f09 to
362ee2f
Compare
Contributor
|
Thanks for the great review @lazaroclapp! I've pushed a few fixes and cleanups, and I think this is ready for another pass. In particular, while testing the |
Contributor
|
/benchmark |
|
Main Branch: With This PR: |
lazaroclapp
approved these changes
Aug 11, 2023
lazaroclapp
left a comment
Contributor
There was a problem hiding this comment.
Ok, finally did a pass on this! There are a few nits that occurred to me, but nothing blocking :)
Contributor
|
Thanks for the detailed review @lazaroclapp! Addressed all remaining comments and will land this one! |
msridhar
enabled auto-merge (squash)
August 12, 2023 22:07
msridhar
added a commit
that referenced
this pull request
Sep 29, 2023
…s classes (#808) This completes a task lingering from #755, which did not handle overriding in anonymous classes. This case is slightly tricky as javac does not preserve annotations on type arguments in the types it computes for anonymous classes. To fix, we pass a `Symbol` where we were passing a `Type` in a couple places, as then we can call `Symbol.isAnonymous()` to check for an anonymous type. In such a case, we try to get the type from the enclosing `NewClassTree` of the overriding method. Note that this PR still does not handle anonymous classes that use the diamond operator; we add a test to show the gaps.
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 PR implements JSpecify-related generics checks for method overriding, including:
See the new tests and docs for further examples.
Note: This PR does not handle overriding in explicitly-typed anonymous inner classes. Those will be handled in a follow-up PR, to keep the PR size manageable.