protected void CheckProtectedModifier ()
{
if ((ModFlags & Modifiers.PROTECTED) == 0)
return;
if (Parent.PartialContainer.Kind == MemberKind.Struct) {
Report.Error (666, Location, "`{0}': Structs cannot contain protected members",
GetSignatureForError ());
return;
}
if ((Parent.ModFlags & Modifiers.STATIC) != 0) {
Report.Error (1057, Location, "`{0}': Static classes cannot contain protected members",
GetSignatureForError ());
return;
}
if ((Parent.ModFlags & Modifiers.SEALED) != 0 && (ModFlags & Modifiers.OVERRIDE) == 0 &&
!(this is Destructor)) {
Report.Warning (628, 4, Location, "`{0}': new protected member declared in sealed class",
GetSignatureForError ());
return;
}
}