-
Notifications
You must be signed in to change notification settings - Fork 510
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
SA1300 misfires on members that implement interfaces #771
Comments
I was thinking about this yesterday actually. I was thinking we could do this:
However, I'm not sure we should make an exception for declarations that implicitly implement an interface member. |
Adding
Why not? The compelling case for me happens frequently: the implementing class actually implements many interfaces (e.g. "But it's worth it," I can hear folks say "...because if you make it public that means the bad name is also visible to folks just using your class." Ya, and I would go for that too. Except the class itself is |
I have a look at this |
One other reason I hit today---sometimes it's simply not an option at all to make it an explicit interface implementation. When an object is exposed to COM as an IDispatch object, the members must actually be public (not explicit interface implementation) or else IDispatch fails. |
Thanks! |
All rules that enforce naming conventions of members should not fire when the member provides an interface implementation.
The rule can and probably should fire on the member in its interface declaration, but not on its implementations. For instance:
On the interface, the rule may fire:
But don't blame the implementation of such a method:
Another example of a place to avoid reporting a diagnostic is explicit interface implementations:
The text was updated successfully, but these errors were encountered: