Skip to content

[ILLink] Fix origin for warnings due to event methods - #100500

Merged
sbomer merged 1 commit into
dotnet:mainfrom
sbomer:fixEventOrigin
Apr 3, 2024
Merged

[ILLink] Fix origin for warnings due to event methods#100500
sbomer merged 1 commit into
dotnet:mainfrom
sbomer:fixEventOrigin

Conversation

@sbomer

@sbomer sbomer commented Apr 1, 2024

Copy link
Copy Markdown
Member

Fixes part of #100499. This fixes the warning origin to prevent warnings from being reported on events for annotated event methods. Instead the warning is shown at the location that introduces the dependency on the event.

Doesn't fix the multiple warnings reported in some cases. This is due to MarkEvent also marking event methods, unlike MarkProperty. We might consider fixing this too, but it was looking like a larger change than I wanted to make here.

This removes some spurious warnings that were showing up when bubbling up RUC in winforms.

@sbomer
sbomer requested a review from marek-safar as a code owner April 1, 2024 22:26
@ghost ghost added the area-Tools-ILLink .NET linker development as well as trimming analyzers label Apr 1, 2024
@dotnet-policy-service dotnet-policy-service Bot added the linkable-framework Issues associated with delivering a linker friendly framework label Apr 1, 2024
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke, @sbomer, @vitek-karas
See info in area-owners.md if you want to be subscribed.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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.

@vitek-karas vitek-karas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@sbomer
sbomer merged commit eb73369 into dotnet:main Apr 3, 2024
matouskozak pushed a commit to matouskozak/runtime that referenced this pull request Apr 30, 2024
This fixes the warning origin to prevent warnings from being
reported on events for annotated event methods. Instead the
warning is shown at the location that introduces the dependency
on the event.

Doesn't fix the multiple warnings reported in some cases. This is
due to MarkEvent also marking event methods, unlike
MarkProperty. We might consider fixing this too, but it was
looking like a larger change than I wanted to make here.

This removes some spurious warnings that were showing up when
bubbling up RUC in winforms.
@github-actions github-actions Bot locked and limited conversation to collaborators May 4, 2024
@sbomer
sbomer deleted the fixEventOrigin branch June 26, 2026 18:07
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.

3 participants