I encountered a compiler error, which for me does not make sense. I have an internal property, and I want to limit its set block to such that it is available only through inheritance. I thought this would work:
internal bool MyProperty { get { return someValue; } protected internal set { someValue = value; } }
But the compiler says that the access modifier in the set block should be more strict than internal - did I miss something, or is protected internal not more restrictive than internal ?
access-modifiers c # properties
Bradley smith
source share