-
Notifications
You must be signed in to change notification settings - Fork 231
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
Fix S4226: False positive for interfaces #1553
Comments
Hi @MaxTranced, Thanks for the feedback. We add a couple of discussions about this because we were not entirely sure where to go with this rule but at the end we decided to tweak the rule to allow extension methods on interface within the same namespace. |
Sounds good to me! 🙂 |
Update: S4226 should only be reported for class extension methods. It should ignore interfaces, structs (which should be lightweight), enums (which cannot have methods) and generics. |
Description
However, adding a method is impossible when an interface is involved (at least for C# language versions prior to v8).
Expected behavior
S4226 is not triggered for interfaces in language versions that don't support default method implementations.
Known workarounds
N/A
Related information
The text was updated successfully, but these errors were encountered: