[Mono-bugs] [Bug 80408][Nor] New - CS0278 reported when hiding method in interface
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Sat Dec 30 12:54:54 EST 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 gert.driesen at pandora.be.
http://bugzilla.ximian.com/show_bug.cgi?id=80408
--- shadow/80408 2006-12-30 12:54:54.000000000 -0500
+++ shadow/80408.tmp.19479 2006-12-30 12:54:54.000000000 -0500
@@ -0,0 +1,57 @@
+Bug#: 80408
+Product: Mono: Compilers
+Version: 1.2
+OS: All
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: C#
+AssignedTo: rharinath at novell.com
+ReportedBy: gert.driesen at pandora.be
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: CS0278 reported when hiding method in interface
+
+When a given method from an interface hides the IEnumerable.GetEnumerator
+method, and another interface implements that interface, then mcs reports
+CS0278.
+
+To reproduce, compile the following code snippet:
+
+using System;
+using System.Collections;
+
+public class Test
+{
+ public void Execute ()
+ {
+ TestCollection a = null;
+ foreach (object x in a) {
+ Console.WriteLine (x);
+ }
+ }
+}
+
+interface ITestCollection : IEnumerable
+{
+ new IEnumerator GetEnumerator ();
+}
+
+interface TestCollection : ITestCollection
+{
+}
+
+Expected result:
+
+Successful compilation.
+
+Actual result:
+
+test.cs(9,3): warning CS0278: `TestCollection' contains ambiguous
+implementation of `enumerable' pattern. Method
+`System.Collections.IEnumerable.GetEnumerator()' is ambiguous with method
+`ITestCollection.GetEnumerator()'
More information about the mono-bugs
mailing list