[Mono-bugs] [Bug 82091][Wis] New - Bogus CS0168 (variable declared but never used)

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Jul 13 10:31:58 EDT 2007


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 monkey at jpobst.com.

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

--- shadow/82091	2007-07-13 10:31:57.000000000 -0400
+++ shadow/82091.tmp.15132	2007-07-13 10:31:58.000000000 -0400
@@ -0,0 +1,48 @@
+Bug#: 82091
+Product: Mono: Compilers
+Version: 1.2
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: monkey at jpobst.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Bogus CS0168 (variable declared but never used)
+
+The following program causes a CS0168 warning when compiled with mcs/gmcs.
+ It generates no errors or warning when compiled with MS.
+
+using System;
+
+public class MyClass2
+{
+	static public void Main ()
+	{
+		bool b = true;
+		object o;
+
+		switch (b) {
+			case true:
+				try {
+					o = "yo";
+					return;
+				} catch (Exception) {
+					return;
+				}
+		}
+	}
+}
+
+Actual Result:
+> gmcs test.cs
+test.cs(8,24): warning CS0168: The variable `o' is declared but never used
+
+Expected Result:
+No warning or error.


More information about the mono-bugs mailing list