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

Allow non-IMemberDefinition sources to be origin for event methods #102613

Merged
merged 2 commits into from
May 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/tools/illink/src/linker/Linker.Steps/MarkStep.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3508,9 +3508,7 @@ protected internal void MarkProperty (PropertyDefinition prop, in DependencyInfo

protected internal virtual void MarkEvent (EventDefinition evt, in DependencyInfo reason, MessageOrigin origin)
{
Debug.Assert (reason.Source is IMemberDefinition or null);
// Use reason as the origin for the event methods unless it's from a descriptor
origin = reason.Source is null ? origin : new MessageOrigin ((IMemberDefinition)reason.Source);
origin = reason.Source is IMemberDefinition member ? new MessageOrigin (member) : origin;
DependencyKind dependencyKind = DependencyKind.EventMethod;

MarkMethodIfNotNull (evt.AddMethod, new DependencyInfo (dependencyKind, evt), origin);
Expand Down