[Mono-bugs] [Bug 74378][Min] New - spurious warning when defining obsolete field with initial value

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 4 Apr 2005 15:23:00 -0400 (EDT)


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=74378

--- shadow/74378	2005-04-04 15:23:00.000000000 -0400
+++ shadow/74378.tmp.28527	2005-04-04 15:23:00.000000000 -0400
@@ -0,0 +1,33 @@
+Bug#: 74378
+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: spurious warning when defining obsolete field with initial value
+
+If you say
+
+	public static readonly double XSmall = 0.6444444444444;
+
+	[Obsolete ("Use XSmall")]
+	public static readonly double X_Small = XSmall;
+
+mcs will say:
+
+        ./Scale.cs(39) warning CS0618: 'Pango.Scale.X_Small' is obsolete:
+'Use XSmall'
+
+If you remove the "= XSmall", there's no warning. Apparently it considers
+setting the value of the field to be "using" it for purposes of the
+warning. But CSC gives no warning in this case.