[Mono-bugs] [Bug 82740][Wis] New - CS0414 not reported for constant that is never used

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Sep 7 14:26:54 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 gert.driesen at pandora.be.

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

--- shadow/82740	2007-09-07 14:26:54.000000000 -0400
+++ shadow/82740.tmp.29604	2007-09-07 14:26:54.000000000 -0400
@@ -0,0 +1,40 @@
+Bug#: 82740
+Product: Mono: Compilers
+Version: 1.2
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: gert.driesen at pandora.be               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: CS0414 not reported for constant that is never used
+
+Currently neither (g)mcs nor csc report CS0414 (2.0) / CS0169 (1.x) when a 
+private constant is never used.
+
+To reproduce, compile the following code snippet:
+
+class Program
+{
+	private const int A = 5;
+
+	static void Main ()
+	{
+	}
+}
+
+Expected result:
+
+MCS:
+test.cs(3,14): warning CS0414: The private field 'Program.A' is assigned 
+but its value is never used
+
+GMCS:
+test.cs(3,14): The private field 'Program.A' is never used


More information about the mono-bugs mailing list