1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
// CS1540: Cannot access protected member `A.X()' via a qualifier of type `B'. The qualifier must be of type `C' or derived from it // Line: 21 class A { protected virtual void X () { } } class B : A { } class C : A { static B b = new B (); static void M () { b.X (); } }