[Mono-bugs] [Bug 75382][Nor] Changed - gmcs causes
ArgumentNullException in ModuleBuilder for IEnumerable<T>
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Sun Jun 26 04:13:00 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=75382
--- shadow/75382 2005-06-26 04:01:37.000000000 -0400
+++ shadow/75382.tmp.31994 2005-06-26 04:13:00.000000000 -0400
@@ -1,14 +1,14 @@
Bug#: 75382
Product: Mono: Compilers
Version: 1.1
-OS:
+OS: unknown
OS Details: Mac OS X tiger
Status: NEW
Resolution:
-Severity:
+Severity: Unknown
Priority: Normal
Component: C#
AssignedTo: mono-bugs at ximian.com
ReportedBy: dr.beyer at gmail.com
QAContact: mono-bugs at ximian.com
TargetMilestone: ---
@@ -119,6 +119,48 @@
project.com
TLS: normal
GC: Included Boehm (with typed GC)
SIGSEGV : normal
Globalization: normal
mac-mini%
+
+------- Additional Comments From dr.beyer at gmail.com 2005-06-26 04:12 -------
+The bug only seems to occur if the local variables are initialized when declared. If the
+variables are not initialized, but rather assigned later, the code compiles successfully:
+
+//----------- t.cs v2 --------------
+using System;
+using System.Collections.Generic;
+
+namespace test
+{
+ class Test<T>
+ {
+ public IEnumerable<T> Lookup(T item)
+ {
+ byte i;
+ byte j;
+ i = 3;
+ j = 3;
+ yield return item;
+ }
+ }
+
+ class Program
+ {
+ public static void Main(string[] args)
+ {
+ Test<string> test = new Test<string>();
+ foreach(string s in test.Lookup("hi") )
+ {
+ Console.WriteLine(s);
+ }
+ }
+ }
+}
+//----------- t.cs v2 --------------
+
+gmcs t.cs
+t.cs(10) warning CS0219: The variable 'i' is assigned but its value is never used
+t.cs(11) warning CS0219: The variable 'j' is assigned but its value is never used
+Compilation succeeded - 2 warning(s)
+
More information about the mono-bugs
mailing list