[Mono-bugs] [Bug 74529][Nor] Changed - mcs fails to detect unassigned variable

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sat, 9 Apr 2005 20:43:15 -0400 (EDT)


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 gonzalo@ximian.com.

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

--- shadow/74529	2005-04-09 15:16:58.000000000 -0400
+++ shadow/74529.tmp.25955	2005-04-09 20:43:15.000000000 -0400
@@ -67,6 +67,31 @@
         Console.WriteLine (service);
     }
 
 }
 
 
+
+------- Additional Comments From gonzalo@ximian.com  2005-04-09 20:43 -------
+Just for the record, mcs correctly detects it in this case:
+--------------
+using System;
+public class Foo {
+    static void Main ()
+    {
+        string name;
+
+        if (name != null){
+            foreach (char b in "hola"){
+                if (b == 'c'){
+                    name = "hey";
+                    break;
+                }
+            }
+        } else {
+            name = "Failed";
+        }
+
+        Console.WriteLine (name);
+    }
+}
+------------