-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ILLink] Add interface implementing type to OverrideInformation and use where it makes sense #98274
Conversation
Tagging subscribers to 'linkable-framework': @eerhardt, @vitek-karas, @LakshanF, @sbomer, @joperezr, @marek-safar Issue DetailsFixes #98255 Adds the type that implements the interface to the
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's possible for a base to provide a static interface method, which seems like it might have broken the old logic. Could you add a testcase for this (using static interface methods, where the interface type isn't instantiated), and try to confirm that this change fixes it?
edit: addressed by your comment at #97487 (comment).
Revert "Look on base types and interfaces for interfaceImpl" This reverts commit 81ebc93. Reapply "Look on base types and interfaces for interfaceImpl" This reverts commit 4320d2195719a68b51efa70fcced1fc5c7c9f6f2. Add test case Simplify test case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM aside from the last few comments, thanks!
I'm not sure how well this InterfaceImplementor concept will translate once you improve support for recursive interfaces, since the impl will no longer always be on the "Implementor" type. But looks good for the current support.
- Rename local - Assert InterfaceType is resolved InterfaceImplementation.InterfaceType
Fixes #98255
Adds the type that implements the interface to the
OverrideInformation
class to be able to properly handle cases where the base provides the interface method or the type relies on a default interface method. Adds theInterfaceImplementor
class that is basically a tuple of(TypeDefinition typeWithInterface, InterfaceImplementation ImplementedInterface)
to do this. Also cleans some unnecessary code inOverrideInformation
and ensures thatOverrideInformation
will have anInterfaceImplementor
if the base method is an interface method.This also reduces allocations of OverrideInformation in a hello world from ~35mb to ~1.2mb.