[Mono-bugs] [Bug 50875][Nor] New - warning CS0219 (-warn:4)

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 8 Feb 2004 14:17:48 -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 gert.driesen@pandora.be.

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

--- shadow/50875	2004-02-08 14:17:48.000000000 -0500
+++ shadow/50875.tmp.14971	2004-02-08 14:17:48.000000000 -0500
@@ -0,0 +1,66 @@
+Bug#: 50875
+Product: Mono/Compilers
+Version: unspecified
+OS: unknown
+OS Details: 
+Status: RESOLVED   
+Resolution: FIXED
+Severity: Unknown
+Priority: Normal
+Component: C#
+AssignedTo: martin@ximian.com                            
+ReportedBy: polak@gnu.org               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: warning CS0219 (-warn:4)
+OtherBugsDependingOnThis: 51310
+
+mcs -warn:4 (-warn:3) produces the following warning:
+
+ test.cs(14) warning CS0219: The variable `o' is assigned but its value is
+never used
+
+while compiling for instance this `test.cs' below:
+
+using System;
+
+class Test
+{
+	public static void Main ()
+	{
+		int x;
+		Foo (out x);
+		Console.WriteLine ("x: " + x);
+	}
+
+	static void Foo (out int x)
+	{
+		object o = "abc";
+		try {
+			// this should generate
+			// an exception
+			x = Convert.ToInt32 (o);
+		}
+		catch (Exception) {
+			// x = something; is missing!
+			return;
+		}
+	}
+}
+
+Of course mcs shouldn't warn about that.
+
+------- Additional Comments From miguel@ximian.com  2003-11-25 00:21 -------
+Assigning to martin
+
+------- Additional Comments From martin@ximian.com  2003-12-13 08:47 -------
+That's a duplicate of a bug I fixed just an hour ago. 
+
+------- Additional Comments From martin@ximian.com  2003-12-16 02:56 -------
+This is not a duplicate; here, the actual bug is the erroneous 
+CS0219. 
+
+------- Additional Comments From martin@ximian.com  2003-12-16 03:31 -------
+Ok, that's now actually fixed in CVS.