[Mono-bugs] [Bug 73038][Min] New - erroneous CS0165 after error in rhs of assignment

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 25 Feb 2005 11:51:52 -0500 (EST)


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 danw@novell.com.

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

--- shadow/73038	2005-02-25 11:51:52.000000000 -0500
+++ shadow/73038.tmp.32171	2005-02-25 11:51:52.000000000 -0500
@@ -0,0 +1,39 @@
+Bug#: 73038
+Product: Mono: Compilers
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Minor
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: danw@novell.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: erroneous CS0165 after error in rhs of assignment
+
+If you have something like:
+
+	using System;
+	
+	public class Err {
+		public static void Main ()
+		{
+			int foo;
+	
+			foo = NoSuchMethod ();
+			Console.WriteLine ("foo = {0}", foo);
+		}
+	}
+
+mcs reports:
+    /tmp/err.cs(8) error CS0103: The name `NoSuchMethod' could not be found
+in `Err'
+    /tmp/err.cs(9) error CS0165: Use of unassigned local variable `foo'
+
+the CS0165 is erroneous. mcs should mark foo as assigned-to even
+though the right-hand side of the assignment failed.