Given the following code:
public static class Super
{
public static class Inner
{
public static string SomeValue { get; set; }
}
public static string SomeValue { get; set; }
}
Resharper tells me that Super.Inner.SomeValue hides a property from the outer class.
How is there hiding going on? You have two distinct references (Super.SomeValue and Super.Inner.SomeValue). And (as far as I know) you cannot use one reference to mean the other variable.
I have found that Resharper is wrong sometimes. But not usually. So I would like to know what it is thinking here.
Any Ideas?
I’m guessing because it means using
SomeValuein the inner class means you get the value assigned to the inner class rather than the outer class.Consider this:
Currently
Super.Sub.OtherValuewill returnInnerbut removing the line I’ve commented will cause it to returnOuter