You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The S3906 rule "Event Handlers should have the correct signature" does not recognize generic types being constrained to EventArgs or to a subclass of it.
Repro steps
Create a method or class with a generic type parameter constrained to EventArgs
Use the constrained generic type as type parameter for EventHandler<> when declaring an event.
The text was updated successfully, but these errors were encountered:
antoinebj
changed the title
S3906: Rule doesn't recognize generic type constraint
S3906: False positive when using generic type constraint
May 10, 2019
Description
The S3906 rule "Event Handlers should have the correct signature" does not recognize generic types being constrained to
EventArgs
or to a subclass of it.Repro steps
Create a method or class with a generic type parameter constrained to
EventArgs
Use the constrained generic type as type parameter for
EventHandler<>
when declaring an event.Example:
Expected behavior
No violation of the rule should be detected.
Actual behavior
A violation of the rule is detected.
Known workarounds
Suppressing the message.
Related information
The text was updated successfully, but these errors were encountered: