Skip to content
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

Merged
merged 2 commits into from
Jan 11, 2024

Conversation

sbomer
Copy link
Member

@sbomer sbomer commented Jan 10, 2024

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.

@ghost ghost added the linkable-framework Issues associated with delivering a linker friendly framework label Jan 10, 2024
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-Tools-ILLink .NET linker development as well as trimming analyzers label Jan 10, 2024
@ghost ghost assigned sbomer Jan 10, 2024
@ghost
Copy link

ghost commented Jan 10, 2024

Tagging subscribers to 'linkable-framework': @eerhardt, @vitek-karas, @LakshanF, @sbomer, @joperezr, @marek-safar
See info in area-owners.md if you want to be subscribed.

Issue Details

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.

Author: sbomer
Assignees: -
Labels:

linkable-framework

Milestone: -

Copy link
Member

@MichalStrehovsky MichalStrehovsky left a 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.

Copy link
Member

@vitek-karas vitek-karas left a 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.

Copy link
Member

@jtschuster jtschuster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@sbomer sbomer merged commit 33446fb into dotnet:main Jan 11, 2024
73 of 76 checks passed
tmds pushed a commit to tmds/runtime that referenced this pull request Jan 23, 2024
* Detect static default interface methods in illink
@github-actions github-actions bot locked and limited conversation to collaborators Feb 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Tools-ILLink .NET linker development as well as trimming analyzers linkable-framework Issues associated with delivering a linker friendly framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Trimmed winforms app crashes
4 participants