-
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
Detect static default interface methods in illink #96821
Conversation
Tagging subscribers to 'linkable-framework': @eerhardt, @vitek-karas, @LakshanF, @sbomer, @joperezr, @marek-safar Issue DetailsFixes #96516. The issue was that we were skipping the TypeMapInfo logic that would have been needed to discover static default interface implementations. While investigating this I noticed more problems in this area (I will file bugs) that I plan to fix separately. For example, the current logic only works for instantiated types, so if you replace
|
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.
Better mark too many methods than too few methods. LGTM.
I double checked that my advice to add the IsStatic
check in #93662 did not in fact cause this regression bug - the previous IsNewSlot
check was already filtering statics on its own since Roslyn doesn't mark static virtuals newslot. That PR is scheduled for servicing so it would by annoying if it was a regression.
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.
Nice - thanks a lot.
...Cases/Inheritance.Interfaces/DefaultInterfaceMethods/StaticDefaultInterfaceMethodOnStruct.cs
Outdated
Show resolved
Hide resolved
...Cases/Inheritance.Interfaces/DefaultInterfaceMethods/StaticDefaultInterfaceMethodOnStruct.cs
Outdated
Show resolved
Hide resolved
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, thank you!
* Detect static default interface methods in illink
Fixes #96516. The issue was that we were skipping the TypeMapInfo logic that would have been needed to discover static default interface implementations.
While investigating this I noticed more problems in this area (I will file bugs) that I plan to fix separately. For example, the current logic only works for instantiated types, so if you replace
struct Derived
in this testcase with a class, it fails.