[Mono-bugs] [Bug 78104][Nor] Changed - yield in 'using' statement cause gmcs compiler crashed
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Thu Jul 13 23:50:45 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 redforks at gmail.com.
http://bugzilla.ximian.com/show_bug.cgi?id=78104
--- shadow/78104 2006-04-25 22:41:31.000000000 -0400
+++ shadow/78104.tmp.28753 2006-07-13 23:50:45.000000000 -0400
@@ -1,13 +1,13 @@
Bug#: 78104
Product: Mono: Compilers
Version: 1.1
OS: All
OS Details: windows xp, GNU/Linux (gentoo)
-Status: RESOLVED
-Resolution: FIXED
+Status: REOPENED
+Resolution:
Severity: Unknown
Priority: Normal
Component: C#
AssignedTo: rharinath at novell.com
ReportedBy: redforks at gmail.com
QAContact: mono-bugs at ximian.com
@@ -73,6 +73,36 @@
- The example code should result in an error. IEnumerable<T> is in
System.Collections.Generic which is not referenced.
- The latest mcs in svn(trunk) does not raise such an error, so if
there was such a problem it is already fixed.
- This bug is absolutely not a critical one.
+
+------- Additional Comments From redforks at gmail.com 2006-07-13 23:50 -------
+The correct code also crashes gmcs:
+
+using System;
+using System.Collections;
+
+class NeedDispose: IDisposable
+{
+ public void Dispose() { }
+}
+
+public class IterTest : IEnumerable
+{
+ public IEnumerator GetEnumerator()
+ {
+ using (new NeedDispose()) {
+ yield return "a";
+ yield return "b";
+ }
+ }
+
+ public static void Main()
+ {
+ foreach (string s in new IterTest())
+ Console.WriteLine(s);
+ }
+}
+
+Both generic and non-generic version of IEnumerator will crashes.
More information about the mono-bugs
mailing list