[Mono-list] [PATCH] "protected internal" semantics

Miguel de Icaza miguel@ximian.com
15 Dec 2002 03:54:20 -0500


Hello,

> Today I've reported an MCS error where it wasn't possible to override
> "protected internal" method with method declared as "protected" in another
> assembly.
> 
> Here's my attempt to fix it: I've added some conditions in "decl.cs" (patch
> included) and some mini test to check this functionality (second and fourth
> compilations should fail under both mcs and csc)
> 
> Can you please verify the patch and commit if it's ok (I'm using read-only
> CVS access)

I ran your test, and tried to compile it with CSC, and CSC reported:

a1.cs(11,26): error CS0507:'C.Test1()': cannot change access modifiers when overriding 'protected internal' inherited member 'A.Test1()'
a1.cs(3,35): (Location of symbol related to previous error)
b1.cs(3,35): error CS0507:'B0.Test1()': cannot change access modifiers when overriding 'protected' inherited member 'A.Test1()'
a0.dll:         (Location of symbol related to previous error)

When compiled with MCS I got:

^Pmono$ mcs /t:library a1.cs
a1.cs(11) error CS0507: `C.Test1': can't change the access modifiers
when overriding inherited member `A.Test1'
Compilation failed: 1 error(s), 0 warnings
mono$ mcs /r:a0.dll /t:library b0.cs
b0.cs(3) error CS0507: `B1.Test1': can't change the access modifiers
when overriding inherited member `A.Test1'
Compilation failed: 1 error(s), 0 warnings
mono$ mcs /r:a0.dll /t:library b1.cs
Block is: 65552
Compilation succeeded

Does your patch move us to compliancy with CSC?  It seems like it would,
but I want to confirm that ;-)

Miguel