NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

3.3.4 Accessibility constraints

Several constructs in the C# language require a type to be at least as accessible as a member or another type. A type T is said to be at least as accessible as a member or type M if the accessibility domain of T is a superset of the accessibility domain of M. In other words, T is at least as accessible as M if T is accessible in all contexts where M is accessible.

The following accessibility constraints exist:

In the example

class A {...}
public class B: A {...}

the B class is in error because A is not at least as accessible as B.

Likewise, in the example

class A {...}
public class B
{
   A F() {...}
   internal A G() {...}
   public A H() {...}
}

the H method in B is in error because the return type A is not at least as accessible as the method.