[Mono-bugs] [Bug 75383][Nor] New - gmcs does not recognize IEnumerator<T> when a class implements IEnumerator<T>

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sun Jun 26 05:33:16 EDT 2005


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 dr.beyer at gmail.com.

http://bugzilla.ximian.com/show_bug.cgi?id=75383

--- shadow/75383	2005-06-26 05:33:16.000000000 -0400
+++ shadow/75383.tmp.4265	2005-06-26 05:33:16.000000000 -0400
@@ -0,0 +1,84 @@
+Bug#: 75383
+Product: Mono: Compilers
+Version: 1.1
+OS: 
+OS Details: Mac OS X tiger
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: dr.beyer at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: gmcs does not recognize IEnumerator<T> when a class implements IEnumerator<T>
+
+Please fill in this template when reporting a bug, unless you know what you are doing.
+Description of Problem:
+
+gmcs does not recognize IEnumerator<T> when a class implements IEnumerator<T>.  The 
+following example is taken from a Microsoft MSDN article at http://msdn.microsoft.com/
+msdnmag/issues/04/05/c20/default.aspx
+
+gmcs appears to be looking for two GetEnumerator methods; one that returns IEnumerator and 
+another that returns IEnumerator<T>.  One class cannot define both of these, of course, and 
+gmcs should only be searching for IEnumerator<T>.
+
+Steps to reproduce the problem:
+1. gmcs t.cs
+
+//--------- t.cs -------------
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+namespace test
+{
+  public class CityCollection : IEnumerable<string>
+  {
+    public IEnumerator<string> GetEnumerator()
+    {
+      yield return "New York";
+      yield return "Paris";
+      yield return "London";
+    }
+  }
+
+  class Program
+  {
+    public static void Main(string[] args)
+    {
+    }
+  }
+}
+//--------- t.cs -------------
+
+Actual Results:
+gmcs t.cs
+t.cs(7) error CS0535: 'test.CityCollection' does not implement interface member 
+'System.Collections.IEnumerable.GetEnumerator()'
+/Library/Frameworks/Mono.framework/Versions/1.1.8.1/lib/mono/2.0/mscorlib.dll: 
+'System.Collections.IEnumerable.GetEnumerator' (name of symbol related to previous error
+Compilation failed: 1 error(s), 0 warnings
+
+Expected Results:
+Compliation should succeed.
+
+How often does this happen? 
+Always
+
+Additional Information:
+
+gmcs --version
+Mono C# compiler version 1.1.5.0
+
+mono --version
+Mono JIT compiler version 1.1.8.1, (C) 2002-2005 Novell, Inc and Contributors. www.mono-
+project.com
+	TLS:           normal
+	GC:            Included Boehm (with typed GC)
+	SIGSEGV      : normal
+	Globalization: normal


More information about the mono-bugs mailing list