Fair enough! Learn something new every day...
;-p
Marc
"Jon Skeet [C# MVP]" <skeet@pobox.com> wrote in message
news:MPG.1df17576aaaed65d98caa4@msnews.microsoft.c om...[color=blue]
> Marc Gravell <mgravell@rm.com> wrote:[color=green]
>> Sorry - I mean't:
>> C can't see E simply because C does not subclass
>> Wrapper, and E is defined (protected) in Wrapper[/color]
>
> 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 - <skeet@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[/color]