[Mono-bugs] [Bug 494822] New: Overriding virtual properties - .NET difference: fails to compile C# code which compiles on .NET
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Tue Apr 14 14:15:02 EDT 2009
http://bugzilla.novell.com/show_bug.cgi?id=494822
Summary: Overriding virtual properties - .NET difference: fails
to compile C# code which compiles on .NET
Classification: Mono
Product: Mono: Compilers
Version: SVN
Platform: i686
OS/Version: Ubuntu
Status: NEW
Severity: Normal
Priority: P5 - None
Component: C#
AssignedTo: mono-bugs at lists.ximian.com
ReportedBy: tom_hindle at sil.org
QAContact: mono-bugs at lists.ximian.com
Found By: ---
Created an attachment (id=285657)
--> (http://bugzilla.novell.com/attachment.cgi?id=285657)
Code mono can't compile, which compiles on .NET
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.8)
Gecko/2009032711 Ubuntu/8.04 (hardy) Firefox/3.0.8
The following code (also included as attachment) doesn't compile with mono.
public class A
{
public virtual object Cache
{
get { return null; }
set { }
}
}
public class B : A
{
public override object Cache
{
set { }
}
}
public class C : B
{
public override object Cache
{
get { return null; }
set { }
}
}
Workaround exists by adding Cache.get implementation to class B
Reproducible: Always
Steps to Reproduce:
1. Compile attached code sample
2.
3.
Actual Results:
/home/hindlet/overridePropertiesTest/overridePropertiesTest/OverridePropertiesTest.cs(25,40):
error CS0545: `OverridePropertiesTest.C.Cache.get': cannot override because
`OverridePropertiesTest.B.Cache' does not have an overridable get accessor
/home/hindlet/overridePropertiesTest/overridePropertiesTest/OverridePropertiesTest.cs(16,40):
(Location of the symbol related to previous error)
Expected Results:
Compiles without warnings or errors
--
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