[Mono-bugs] [Bug 29512][Wis] New - Incorrect checking of variable inizialization
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
27 Aug 2002 15:49:32 -0000
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 ric@users.sourceforge.net.
http://bugzilla.ximian.com/show_bug.cgi?id=29512
--- shadow/29512 Tue Aug 27 11:49:32 2002
+++ shadow/29512.tmp.11237 Tue Aug 27 11:49:32 2002
@@ -0,0 +1,56 @@
+Bug#: 29512
+Product: Mono/MCS
+Version: unspecified
+OS: other
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: Misc
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: ric@users.sourceforge.net
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Incorrect checking of variable inizialization
+
+When compiling the following code:
+
+
+namespace T1 {
+ using System;
+ using System.Reflection;
+
+ public class T {
+
+ public static void Main (string[] args)
+ {
+ MemberInfo[] mi;
+ Type t;
+ String s = "abc";
+
+ Console.WriteLine ("{0}", s);
+
+ t = s.GetType ();
+
+ Console.WriteLine ("{0}", t);
+
+ mi = t.FindMembers (MemberTypes.Method,
+ BindingFlags.Static || BindingFlags.Instance
+ || BindingFlags.Public || BindingFlags.NonPublic,
+ Type.FilterName, "ToString");
+
+ Console.WriteLine ("{0}", mi); /* this is line 25 */
+ }
+ }
+}
+
+I get the following error:
+
+t.cs(25) error CS0165: Use of unassigned local variable `mi'
+Compilation failed: 1 error(s), 0 warnings
+
+which is wrong. Also, if I comment out line 25, mcs produces incorrect
+code. It does produce correct code if i comment both lines 25 and 20.