[Mono-bugs] [Bug 75055][Min] New - Incorrect CS0169 warning in generic class

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu May 26 17:11:39 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 emrysk at gmail.com.

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

--- shadow/75055	2005-05-26 17:11:38.000000000 -0400
+++ shadow/75055.tmp.13628	2005-05-26 17:11:38.000000000 -0400
@@ -0,0 +1,49 @@
+Bug#: 75055
+Product: Mono: Compilers
+Version: 1.1
+OS: 
+OS Details: Ubuntu Linux 5.04 (Hoary)
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Minor
+Component: C#
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: emrysk at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Incorrect CS0169 warning in generic class
+
+The following chunk of code will claim "CS0169: The private field
+'MyEnumerator`1._e' is never used" with Mono 1.1.7.  The test case is an
+implementation of IEnumerator<>.  (Sorry about the length. I'm in a bit of
+a rush and didn't have time to try and shorten it.)
+
+---
+
+using System.Collections.Generic;
+
+class MyEnumerator<T> : IEnumerator<T>
+{
+	IEnumerator<T> _e;
+
+	public T Current { get { return _e.Current; } }
+
+	object System.Collections.IEnumerator.Current
+	{ get { return _e.Current; } }
+	
+	public MyEnumerator(IEnumerable<T> a)
+	{
+		_e = a.GetEnumerator();
+	}
+
+	public bool MoveNext() { return _e.MoveNext(); }
+
+	public void Reset() { _e.Reset(); }
+
+	public void Dispose() { _e.Dispose(); }
+}
+
+class Program { static void Main() { } }


More information about the mono-bugs mailing list