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
{{ message }}
Repository navigation
SA1202 wrongly treats explicit interface implementations as private #1179
Legacy StyleCop correctly treats members that explicitly implement an interface member as public. The new analyzers, however, treat these as private.
internal interface IA
{
string T { get; }
int U { get; }
}
class Test : IA
{
public int Q { get; set; }
string IA.T
{
get { return null; }
}
// SA1202 (All public properties must come before all private properties) wrongly reported here.
public int W { get; set; }
protected string S { get; set; }
// SA1202 should be reported here (according to legacy StyleCop), but is not.
int IA.U
{
get { return 0; }
}
}
Interestingly, explicit implementations are treated as public by legacy StyleCop even when they implement an internal interface. (I used an internal interface in my example; the results are the same if you make it public.)
@marcospgp, this issue was marked as fixed in 2015, so it was definitely resolved. Please create a new issue with a small but complete example that it misbehaves on if you are seeing unwanted behavior.
Activity
sharwell commentedon Aug 10, 2015
Ugh. 🐛
I'm glad you are so persistent with checking these. 😄
Marking up for grabs although I expect @Noryoko will jump on it.
Noryoko commentedon Aug 10, 2015
You would be correct in that assumption.
marcospgp commentedon Aug 2, 2024
I see this issue has been closed, but has this been resolved? I just ran into this today using
stylecop.analyzers.1.1.118:bjornhellander commentedon Aug 2, 2024
@marcospgp, this issue was marked as fixed in 2015, so it was definitely resolved. Please create a new issue with a small but complete example that it misbehaves on if you are seeing unwanted behavior.