[Mono-bugs] [Bug 62673][Wis] Changed - Spurious warning CS0169

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed Mar 22 07:37:33 EST 2006


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 marek.safar at seznam.cz.

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

--- shadow/62673	2005-04-17 13:42:41.000000000 -0400
+++ shadow/62673.tmp.6612	2006-03-22 07:37:33.000000000 -0500
@@ -10,13 +10,12 @@
 Component: C#
 AssignedTo: miguel at ximian.com                            
 ReportedBy: colin at breame.com               
 QAContact: mono-bugs at ximian.com
 TargetMilestone: ---
 URL: 
-Cc: 
 Summary: Spurious warning CS0169
 
 The warning CS0169 "Private field `A.name' is never used" is reported
 incorrectly.
 
 e.g.  Try to compile with -warn:4
@@ -50,6 +49,25 @@
 Don't we emit warning messages like "varibale X assigned but never
 used" for a local method? Wouldn't this just be an extension of that?
 
 OTOH, in the local variable case, the jit is free to optimize away the
 variable -- it isn't really keeping anything alive. This isn't true in
 the case of a field.
+
+------- Additional Comments From marek.safar at seznam.cz  2006-03-22 07:37 -------
+I think we can close this as we simply report more warnings than csc.
+
+And because csc does report warning for code like this, it is simply
+csc bug (not first one in their warning code).
+
+public class A {
+    public A(string name)
+    {
+       	string name2;
+	name2 = name;
+     }
+    
+    static void Main () {}
+}
+
+Note: csc reports no warning for this but when you compile with /o+ no
+code is emitted for ctor.


More information about the mono-bugs mailing list