<?xml version="1.0"?>
<ErrorDocumentation xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <ErrorName>CS1540</ErrorName>
  <Examples>
    <string>// CS1540: Cannot access protected member `AAttribute.AAttribute(int)' via a qualifier of type `AAttribute'. The qualifier must be of type `BAttribute' or derived from it
// Line: 17

using System;

public class AAttribute : Attribute
{
	public AAttribute ()
	{
	}

	protected AAttribute (int a)
	{
	}
}

[AAttribute (5)]
public class BAttribute : AAttribute
{
	public BAttribute () : base ()
	{
	}
	
	public BAttribute (int a) : base (a)
	{
	}
}
</string>
    <string>// CS1540: Cannot access protected member `object.MemberwiseClone()' via a qualifier of type `anonymous type'. The qualifier must be of type `A' or derived from it
// Line: 9

class A
{
	public A ()
	{
		var x = new { s = "-" };
		x.MemberwiseClone();
	}
}
</string>
    <string>// CS1540: Cannot access protected member `A.n' via a qualifier of type `A'. The qualifier must be of type `B' or derived from it
// Line: 14

class A
{
    protected int n;
}

class B : A
{
    public static void Main ()
	{
		A b = new A ();
		b.n = 1;
	}
}
</string>
    <string>// CS1540: Cannot access protected member `A.Foo()' via a qualifier of type `D2'. The qualifier must be of type `D' or derived from it
// Line: 8
// Compiler options: -r:CS1540-17-lib.dll

class D : B
{
	public void Test ()
	{
		C.Get().Foo ();
	}
}

class D2 : B
{
}

class B : A
{
}

class C
{
	public static D2 Get ()
	{
		return new D2 ();
	}
}
</string>
    <string>// CS1540: Cannot access protected member `Test.A.Property' via a qualifier of type `Test.A'. The qualifier must be of type `Test.B.C' or derived from it
// Line: 19

namespace Test
{
    public class A
    {
        protected int Property {
            get { return 0; }
        }
    }
 
    public class B : A
    {
        private sealed class C
        {
            public C (A a)
            {
                int test = a.Property;
                test++;
            }
        }
    } 
}</string>
    <string>// CS1540: Cannot access protected member `A.f' via a qualifier of type `A'. The qualifier must be of type `B' or derived from it
// Line: 9

class A {
	protected int f { get { return 1; } }
}

class B : A {
         int baz () { return new A().f; }
   }
 
</string>
    <string>// 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)
        {
        }
    }

}
</string>
    <string>// CS1540: Cannot access protected member `A.this[int]' via a qualifier of type `B'. The qualifier must be of type `C' or derived from it
// Line: 14

class A {
	protected int this [int i] { get { return i; } }
}

class B : A { }

class C : A {
	static int Main ()
	{
		B b = new B ();
		return b [0];
	}
}
</string>
    <string>// CS1540: Cannot access protected member `A.Test(int)' via a qualifier of type `B'. The qualifier must be of type `C' or derived from it
// Line: 28
using System;

public abstract class A
{
	protected virtual void Test (int a)
	{ }

	public void Test ()
	{ }
}

public class B : A
{
	protected override void Test (int a)
	{
		base.Test (a);
	}
}

public class C : A
{
	private B B;

	protected override void Test (int a)
	{
		B.Test (a);
		base.Test (a);
	}
}

class X
{
	static void Main ()
	{ }
}
</string>
    <string>// 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 ();
        }
}</string>
    <string>// CS1540: Cannot access protected member `A.member' via a qualifier of type `A'. The qualifier must be of type `B' or derived from it
// Line: 17
// NOTE: csc report simple inaccessible error which is less precise

using System;

class A
{
       protected event EventHandler member;
}

class B : A
{
       static void Main ()
       {
               A a = new A ();
               a.member += Handler;
       }
       
       static void Handler (object sender, EventArgs args) {}
}
</string>
    <string>// CS1540: Cannot access protected member `A.Test.get' via a qualifier of type `B'. The qualifier must be of type `C' or derived from it
// Line: 17

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

class B : A
{
}

class C : A
{
	public void Test2 (B b)
	{
		foreach (object o in b.Test) {
		}
	}
}
</string>
    <string>// CS1540: Cannot access protected member `A.A(int)' via a qualifier of type `A'. The qualifier must be of type `B' or derived from it
// Line: 25

public class A
{
	protected A (int a)
	{
	}
}

public class B : A
{
	public B ()
		: base (1)
	{
	}
	
	public static void Main ()
	{
		A a = new A (1);
	}
}
</string>
    <string>// CS1540: Cannot access protected member `Parent.Foo()' via a qualifier of type `Parent'. The qualifier must be of type `Child' or derived from it
// Line: 8
// Compiler options: -r:CS1540-15-lib.dll

public class Child : Parent
{
	public void Bar (Parent p)
	{
		p.Foo ();
	}
}
</string>
    <string>// CS1540: Cannot access protected member `A.n()' via a qualifier of type `A'. The qualifier must be of type `B' or derived from it
// Line: 14

class A
{
        protected void n () { }
}

class B : A
{
        public static void Main ()
	{
		A b = new A ();
		b.n ();
	}
}



</string>
    <string>// CS1540: Cannot access protected member `A.A(A)' via a qualifier of type `A'. The qualifier must be of type `B' or derived from it
// Line: 25

public class A {
	public A ()
	{
	}

	protected A (A a)
	{
	}
}

public class B : A {
	public B () : base ()
	{
	}
	
	public B (A a) : base (a)
	{
	}
	
	public A MyA {
		get {
			A a = new A (this);
			return a;
		}
	}
}
</string>
    <string>// CS1540: Cannot access protected member `A.n' via a qualifier of type `B'. The qualifier must be of type `C.N' or derived from it
// Line: 12

class A {
	protected int n = 0;
}

class B : A { }

class C : B {
	class N {
		static internal int foo (B b) { return b.n; }
	}
	public static int Main () {
		return N.foo (new B ());
	}
}
</string>
    <string>// CS1540: Cannot access protected member `A.n' via a qualifier of type `B'. The qualifier must be of type `C' or derived from it
// Line: 19

class A
{
        protected int n;
}
 
class B : A
{
}
 
class C : A
{
        static B b = new B ();
 
        static void Main ()
        {
                b.n = 1;
        }
}
</string>
    <string>// CS1540: Cannot access protected member `Parent.Foo()' via a qualifier of type `T'. The qualifier must be of type `Child&lt;T&gt;' or derived from it
// Line: 9
// Compiler options: -r:CS1540-15-lib.dll

public class Child&lt;T&gt; : Parent where T : Parent
{
	public void Bar (T p)
	{
		p.Foo ();
	}
}
</string>
    <string>// CS1540: Cannot access protected member `A.del' via a qualifier of type `A'. The qualifier must be of type `B' or derived from it
// Line: 16

delegate int D ();

class A
{
	protected D del;
}

class B : A
{
    public static void Main ()
	{
		A b = new A ();
		var v = b.del ();
	}
}
</string>
  </Examples>
</ErrorDocumentation>