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

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 27 Apr 2004 23:11:21 -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 martin@ximian.com.

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

--- shadow/57747	2004-04-27 23:11:12.000000000 -0400
+++ shadow/57747.tmp.29799	2004-04-27 23:11:21.000000000 -0400
@@ -1,10 +1,10 @@
 Bug#: 57747
 Product: Mono: Compilers
 Version: unspecified
-OS: 
+OS: unknown
 OS Details: 
 Status: NEW   
 Resolution: 
 Severity: 040 One week
 Priority: Wishlist
 Component: C#
@@ -17,6 +17,26 @@
 Summary: We no do track definite assignment of expressions (12.3.3.23-26)
 
 We did not implement the definite assignment rules wrt. `&&' and `||'
 expressions.  The testcases are from bug #41787.
 
 Setting priority to wishlist, severity = 40.
+
+------- Additional Comments From martin@ximian.com  2004-04-27 23:11 -------
+using System;
+
+class Test14 {
+  static void F(bool b, int i) {
+    int x;
+    if (b && (x = i) >= 0)
+      // OK: 'x' definitely assigned
+      Console.WriteLine(x);
+    else
+      // Error: 'x' not definitely assigned
+      Console.WriteLine(x);
+  }
+
+  public static void Main() {
+    F(true,5);
+    F(false,7);
+  }
+}