Marc Gravell <mg******@rm.com> wrote:
Sorry - I mean't:
C can't see E simply because C does not subclass
Wrapper, and E is defined (protected) in Wrapper
No, C can definitely see E due to being nested within T. See section
10.5.2 of the spec (ECMA numbering):
<quote>
The accessibility domain of a nested member M declared in a type T
within a program P, is defined as follows (noting that M itself may
possibly be a type):
[...]
If the declared accessibility of M is protected, let D be the union of
the program text of T and the program text of any type derived from T.
</quote>
Now, in our case, C is within the program text of Wrapper, so it has
access to E.
The problem is that things which may logically be able to call foo (by
deriving from C) wouldn't have access to E.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog:
http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too