summaryrefslogtreecommitdiff
path: root/mcs/errors/cs1540-7.cs
blob: 6e0d61b3229c866ce31a8d90cc644c3c8159612f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// CS1540: Cannot access protected member `A.Test' via a qualifier of type `B'. The qualifier must be of type `C' or derived from it
// Line: 17

class A
{
    protected object[] Test { get { return null; } }
}

class B : A
{
}

class C: A
{
    public void Test2 (B b)
    {
        foreach (object o in b.Test)
        {
        }
    }

}