-
Notifications
You must be signed in to change notification settings - Fork 507
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
Explicit interface implementation triggers access level error #3881
Comments
And why do you think this is a bug? #1179 (comment) |
It's not quite clear what the issue being reported is (primarily because SA1202 involves the relation between two different members, but only one member is shown). Explicit interface implementations were treated as public by StyleCop Classic. StyleCop Analyzers intentionally preserved this behavior. During the creation of this project, the default behavior was always to follow StyleCop Classic (for ease of migration for existing users) unless a change was warranted. If the intended behavior was unclear due to ambiguity or omissions in the old documentation, our preference was to preserve the implementation behavior and clarify the documentation. We tried to only change behavior in cases where rules were found to be in direct conflict with each other, or were largely/fundamentally incompatible with explicit guidance being given by the language team. In those cases, we tried to document the differences in Known Changes. |
since interfaces can only define public abstract methods, it makes sense to assume an explicit interface implementation will always be public - even if it is only accessible by casting an instance to the interface type is there any chance the error message could be updated to include this information? or as a fallback, the documentation? |
Ran into this today using
stylecop.analyzers.1.1.118
:The text was updated successfully, but these errors were encountered: