dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pnet-developers] Re: Possible misinterpretation of 'protected internal'


From: Carl-Adam Brengesjo
Subject: [Pnet-developers] Re: Possible misinterpretation of 'protected internal'
Date: Tue, 07 Sep 2004 16:00:58 +0200
User-agent: Mozilla Thunderbird 0.6 (Windows/20040502)

Eh, testcase provided should not compile, as it's X that's calling foo().
Only derived classes of A and classes in same assembly as A is allowed.
If a call to foo() fails from class B, then the problem you describe should occur -- not in the case provided. Maybey if you declare a method in B, with the `new` flag, and it fails -- but not in the case provided.

Bug is bogus.

Dominique Canazzi wrote:
Summary:  Possible misinterpretation of 'protected internal'

Original Submission:  cscc seems to interpret this combination as "protected AND 
internal". ECMA says "internal, OR ELSE protected".

Example:

   public class A
   {
      protected internal void foo () {}
   }
   public class B : A
   {
      private class X
      {
         private A owner;
         public void SomeMethod ()
         {
            B myOwner = owner as B;
            myOwner.foo ();
         }
      }
   }

does not compile when A and B defined in different assemblies.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]