[Mono-bugs] [Bug 78367][Nor] New - incorrect CS0019 : hidden member
takes precedence over "new" member on resolving member
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Thu May 11 06:47:34 EDT 2006
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by atsushi at ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=78367
--- shadow/78367 2006-05-11 06:47:34.000000000 -0400
+++ shadow/78367.tmp.21903 2006-05-11 06:47:34.000000000 -0400
@@ -0,0 +1,76 @@
+Bug#: 78367
+Product: Mono: Compilers
+Version: 1.1
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: C#
+AssignedTo: rharinath at novell.com
+ReportedBy: atsushi at ximian.com
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: incorrect CS0019 : hidden member takes precedence over "new" member on resolving member
+
+In the following code, there are "new Bar Document" in the derived class
+XElement, and "Foo Document" in the base class Element.
+
+In CrashHere(), Document.Root should be regarded as IHoge as defined in
+Bar. Since IHoge could be a derived class from XElement, this expression
+should be allowed.
+
+--------
+
+namespace TestNS
+{
+ public interface IHoge {}
+
+ public class Foo {}
+
+ public class XElement : Element
+ {
+ public new Bar Document { get { return null; } }
+
+ public object CrashHere {
+ get { return (Document.Root == this) ? null : ""; }
+ }
+ }
+
+ public class Element
+ {
+ public Foo Document { get { return null; } }
+ }
+
+ public class Bar
+ {
+ public IHoge Root { get { return null; } }
+ }
+--------
+
+
+Actual Results:
+
+- svg.cs(11,18): error CS0019: Operator `==' cannot be applied to operands
+of type `TestNS.Bar.Root' and `TestNS.XElement'
+
+
+Expected Results:
+
+- no CS0019 error.
+
+
+How often does this happen?
+
+- consistently.
+
+
+Additional Information:
+
+The same problem happens when you create another derived class YElement and
+move CrashHere() method there.
+
+I extracted this small repro code from SharpVectorGraphics 0.4 Alpha.
More information about the mono-bugs
mailing list