[Mono-bugs] [Bug 57747][Nor] Changed - We no do track definite assignment of expressions (12.3.3.23-26)

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Sep 1 05:42:22 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 atsushi at ximian.com.

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

--- shadow/57747	2005-05-20 04:23:42.000000000 -0400
+++ shadow/57747.tmp.9325	2005-09-01 05:42:22.000000000 -0400
@@ -2,14 +2,14 @@
 Product: Mono: Compilers
 Version: unspecified
 OS: unknown
 OS Details: 
 Status: NEW   
 Resolution: 
-Severity: 040 One week
-Priority: Wishlist
+Severity: Unknown
+Priority: Normal
 Component: C#
 AssignedTo: mono-bugs at ximian.com                            
 ReportedBy: martin at ximian.com               
 QAContact: mono-bugs at ximian.com
 TargetMilestone: ---
 URL: 
@@ -90,6 +90,70 @@
 
 ------- Additional Comments From bmaurer at users.sf.net  2005-05-19 21:19 -------
 *** Bug 74894 has been marked as a duplicate of this bug. ***
 
 ------- Additional Comments From martin at ximian.com  2005-05-20 04:23 -------
 Maybe I should have a look at this someday ....
+
+------- Additional Comments From atsushi at ximian.com  2005-09-01 05:42 -------
+Another set of examples that does not use if-statement:
+
+--------
+class Test
+{
+	public int AbsOK (bool b, int i)
+	{
+		int x;
+		int y = true ? (x = i) : (x = i);
+		return x;
+	}
+
+	public int FooOK (bool b, int i)
+	{
+		int x;
+		int y = true ? (x = i) : 0;
+		return x;
+	}
+
+	public int BarOK (bool b, int i)
+	{
+		int x;
+		int y = false ? 0 : (x = i);
+		return x;
+	}
+
+	public int FooNG1 (bool b, int i)
+	{
+		int x;
+		int y = true ? 0 : (x = i);
+		return x;
+	}
+
+	public int BarNG1 (bool b, int i)
+	{
+		int x;
+		int y = false ? (x = i) : 0;
+		return x;
+	}
+
+	public int FooNG2 (bool b, int i)
+	{
+		int x;
+		int y = b ? (x = i) : 0;
+		return x;
+	}
+
+	public int BarNG2 (bool b, int i)
+	{
+		int x;
+		int y = b ? 0 : (x = i);
+		return x;
+	}
+}
+
+
+expected output:
+57747z.cs(28,10): error CS0165: Use of unassigned local variable 'x'
+57747z.cs(35,10): error CS0165: Use of unassigned local variable 'x'
+57747z.cs(42,10): error CS0165: Use of unassigned local variable 'x'
+57747z.cs(49,10): error CS0165: Use of unassigned local variable 'x'
+


More information about the mono-bugs mailing list