Fix MissingMethodException when proxying interfaces containing sealed methods#621
Merged
stakx merged 3 commits intocastleproject:masterfrom Jul 22, 2022
Merged
Conversation
228d0e7 to
b5eddd2
Compare
jonorossi
approved these changes
Jul 19, 2022
b5eddd2 to
95819d5
Compare
Two changes need to be made to `InterfaceMembersCollector`:
1. `AcceptMethod` needs to be called with `onlyVirtuals: true`, so that
it will filter out non-overridable methods during pre-screening.
2. For such filtered-out methods, it needs to return `null` in order to
avoid `MinimalisticMethodGenerator` (which would mark the method it
creates as an override).
These changes have been copied from `ClassMembersCollector`. Note that
the two classes are now almost identical.
95819d5 to
9c58968
Compare
Member
Author
|
This may not be totally complete (the same problem may persist for other proxy types) but it's still a step in the right direction. So instead of letting this rot away, I'll merge it. I'll likely pick this topic up again as I'm still working on better support for new interface capabilities. |
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 is a first small step towards support for default interface methods (#447).
Not certain whether this warrants a changelog entry on its own, since what is being fixed here never got reported as an issue. Perhaps we just wait with a changelog entry until we have fully addressed #447?
P.S.: marking this as a draft as it may be incomplete; the same issue may still be present with proxies that have a target.