I was expecting the assignment to this.GetProp
to fail at compile time due to no set
supported for the property. This code compiled just fine with VS2015 & NET461.
public class Example
{
public Example(string val)
{
this.GetProp = val;
this.GetSetProp = val;
}
public string GetProp { get; }
public string GetSetProp { get; set; }
}
Is there are implied private access to the backing field in auto properties?