Accessibility Domains???

  • Thread starter Thread starter agro_r
  • Start date Start date
A

agro_r

The ECMA C# standard states this:

Suppose M is a member nested on type T within program P. Then the
accessibility domain of M is:

If the declared accessibility of M is
protected, let D be the union of the
program text of T [the part between { and } of T's
definition - added by me] and the program text of any
type derived from T. The accessibility domain of M is the
intersection of the accessibility domain of T [i:30cd915bf1][let's
call this A(T) - added by me][/i:30cd915bf1] with D

(page 73)

I've tried to find cases where the intersection of D and A(T) isn't
equal to D, but I can't find any!!! This part of standard is really
making me nuts :evil: , so can anyone help me try to find a case
where "A(T) intersection D" isn't equal D? If such case doesn't
exist, then should the standard be better of by just saying that the
accessibility domain of M is D?

Thanks a lot beforehand...
 
agro_r said:
The ECMA C# standard states this:

Suppose M is a member nested on type T within program P. Then the
accessibility domain of M is:

If the declared accessibility of M is
protected, let D be the union of the
program text of T [the part between { and } of T's
definition - added by me] and the program text of any
type derived from T. The accessibility domain of M is the
intersection of the accessibility domain of T [i:30cd915bf1][let's
call this A(T) - added by me][/i:30cd915bf1] with D

(page 73)

I've tried to find cases where the intersection of D and A(T) isn't
equal to D, but I can't find any!!! This part of standard is really
making me nuts :evil: , so can anyone help me try to find a case
where "A(T) intersection D" isn't equal D? If such case doesn't
exist, then should the standard be better of by just saying that the
accessibility domain of M is D?

I think you are right about this - the wording is unnecessarily complex.

You cannot derive a type from T outside T's accessibility domain. Therefore
D is always a subset of A(T), and it follows that the intersection of A(T)
and D is always D.

Sami
www.capehill.net
 
Back
Top