[Mono-bugs] [Bug 506757] New: CS0507 when overriding public method in class generated by ikvmc
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Mon May 25 01:07:31 EDT 2009
http://bugzilla.novell.com/show_bug.cgi?id=506757
Summary: CS0507 when overriding public method in class
generated by ikvmc
Classification: Mono
Product: Mono: Compilers
Version: 2.4.x
Platform: All
OS/Version: All
Status: NEW
Severity: Normal
Priority: P5 - None
Component: C#
AssignedTo: mono-bugs at lists.ximian.com
ReportedBy: jeroen at sumatra.nl
QAContact: mono-bugs at lists.ximian.com
Found By: ---
Created an attachment (id=294098)
--> (http://bugzilla.novell.com/attachment.cgi?id=294098)
IL source
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64;
Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 1.1.4322;
NET CLR 3.5.30729; InfoPath.2; .NET CLR 3.0.30729; .NET CLR 4.0.20506)
In Java it is legal to widen access when overriding a method, so ikvmc can
generate assemblies that contain classes that do this.
When mcs encounters a C# class that overrides a public method (with a public
method) it should accept this instead of considering the protected method in
some base class.
See attached repro. Note that the repro contains an intermediate class
(__WorkaroundBaseClass__.test) that is a workaround for a related bug in csc,
but this workaround doesn't work (or affect) the problem with mcs.
Note that this is a showstopper for IKVM compilation on Mono, because the Sun
AWT toolkit uses this construct.
Reproducible: Always
Steps to Reproduce:
1. ilasm /dll test.il
2. mcs test.cs -r:test.dll
Actual Results:
test.cs(11,24): error CS0507: `test1.foo()': cannot change access modifiers
when
overriding `protected internal' inherited member
`__WorkaroundBaseClass__.test.
foo()'
Expected Results:
Successful compile.
test.cs:
public class test1 : test
{
public override void foo() { }
}
--
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the mono-bugs
mailing list