Skip to content

MA0093: do not offer EventArgs.Empty when the event args are generic - #1663

Merged
meziantou merged 1 commit into
mainfrom
feature/fuzz-ma0093-generic-event-args
Oct 18, 2026
Merged

meziantou merged 1 commit into
mainfrom
feature/fuzz-ma0093-generic-event-args

Conversation

@meziantou

Copy link
Copy Markdown
Owner

MyEvent?.Invoke(this, null) with a delegate whose event args are a type parameter constrained to EventArgs was fixed as Invoke(this, EventArgs.Empty), which does not compile (CS1503). The fix is now only registered when EventArgs is implicitly convertible to the type of the argument. The diagnostic is still reported.

Regression test: InvalidEventArgs_GenericEventArgs_NoCodeFix.

@meziantou
meziantou merged commit f190384 into main Oct 18, 2026
14 checks passed
@meziantou
meziantou deleted the feature/fuzz-ma0093-generic-event-args branch October 18, 2026 04:20
This was referenced Oct 18, 2026
This was referenced Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant