[Mono-bugs] [Bug 75721][Nor] New - CS0165 is not reported. Breaks Mono build on Windows.

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Aug 5 00:50:41 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 gert.driesen at pandora.be.

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

--- shadow/75721	2005-08-05 00:50:40.000000000 -0400
+++ shadow/75721.tmp.17061	2005-08-05 00:50:40.000000000 -0400
@@ -0,0 +1,72 @@
+Bug#: 75721
+Product: Mono: Compilers
+Version: 1.0
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: gert.driesen at pandora.be               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: CS0165 is not reported. Breaks Mono build on Windows.
+
+To reproduce this issue, compile the following code snippet:
+
+using System.Collections;
+
+public class EntryPoint {
+  public static void Main() {
+    ArrayList fields = new ArrayList();
+
+    Field fb;
+    for (int i = 0; i < fields.Count; i++) {
+      if (((Field) fields[i]).Name == "abc") {
+        fb = (Field) fields[i];
+	break;
+      }
+    }
+
+    if (fb.Name != "b") {
+    }
+  }
+
+  public class Field
+  {
+    public string Name;
+  }
+}
+
+Actual result:
+
+Successful compilation.
+
+Expected result:
+
+test.cs(14,7): error CS0165: Use of unassigned local variable 'fb'
+
+This breaks the mono build on win32, when compiling mbas:
+
+Creating ../build/deps/mbas.exe.response ...
+csc.exe /lib:../class/lib/default /r:System.dll /r:../class/lib/default/Mo
+no.Get
+Options.dll /r:../class/lib/default/Microsoft.VisualBasic.dll /nologo /opt
+imize
+-d:NET_1_1 -d:ONLY_1_1 /debug+ /debug:full -target:exe -out:mbas.exe mb-
+parser.c
+s  @../build/deps/mbas.exe.response
+decl.cs(295,4): warning CS0168: The variable 'exp' is declared but never 
+used
+expression.cs(3342,24): error CS0165: Use of unassigned local 
+variable 'fb'
+expression.cs(3375,10): error CS0165: Use of unassigned local 
+variable 'fb'
+expression.cs(3406,10): error CS0165: Use of unassigned local 
+variable 'fb'
+make[1]: *** [mbas.exe] Error 1
+make[1]: Leaving directory `/cygdrive/d/projects/mono/head/mcs/mbas'


More information about the mono-bugs mailing list