[Mono-bugs] [Bug 70722][Min] New - erroneous warning cs0672

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 21 Dec 2004 10:45:20 -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 danw@novell.com.

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

--- shadow/70722	2004-12-21 10:45:20.000000000 -0500
+++ shadow/70722.tmp.8183	2004-12-21 10:45:20.000000000 -0500
@@ -0,0 +1,49 @@
+Bug#: 70722
+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: erroneous warning cs0672
+
+given this:
+
+	using System;
+	
+	public class Foo {
+		[Obsolete]
+		public void Something ()
+		{
+			;
+		}
+	}
+	
+	public class Bar : Foo {
+		public new void Something ()
+		{
+			;
+		}
+	
+		public static void Main ()
+		{
+			;
+		}
+	}
+
+mcs reports:
+/tmp/obs.cs(12) warning CS0672: Member 'Bar.Something()' overrides obsolete
+member. Add the Obsolete attribute to 'Bar.Something()'
+/tmp/obs.cs(5): 'Foo.Something()' (name of symbol related to previous warning
+
+which is wrong, because Bar's Something is "new", not an override
+of Foo's Something. Visual Studio doesn't report a warning.