[Mono-list] "protected internal" semantics
Jaroslaw Kowalski
jarek@atm.com.pl
Sat, 14 Dec 2002 13:52:39 +0100 (CET)
Hi!
What is the correct semantics of "protected internal" when used with
"abstract/override"? Consider the following:
--- a.cs: --------------------------------------------------
public abstract class A
{
protected internal abstract void Test1();
public static void Main(string[] args)
{
}
}
--- b.cs: --------------------------------------------------
public class B : A
{
protected override void Test1()
{
}
}
------------------------------------------------------------
On Windows it compiles fine:
csc.exe /t:library a.cs
csc.exe /r:a.dll /t:library b.cs
On Linux:
mcs -t:library a.cs
mcs -t:library -r:a.dll b.cs
it produces an error:
---------
b.cs(3) error CS0507: `B.Test1': can't change the access
modifiers when overriding inherited member `A.Test1'
---------
However, when "B.Test1()" is "protected internal override" it
compiles with mcs but not csc (also CS0507 error)
I guess you have made it exactly the opposite way. Or is it csc's bug?
Jarek