[Mono-dev] Reason for introduction of CS0809 warning in mcs ?

Atsushi Eno atsushi at ximian.com
Sat Jan 6 10:51:00 EST 2007


Hi,

To understand the issue precisely, does it warn something like
"marking overriden member as obsolete is bogus" ? For example:

public class Class1
{
   public virtual void Foo () {}
}

public class Class2 : Class1
{
   [Obsolete]
   public override void Foo () {}
}

If so, I support this warning. That member marked as obsoleted
could be used by referencing Class1.Foo() and thus there is no
point of warning only Class2.Foo() since depending on the usage
this obsolete warning cannot be caught. So, it sounds like a
bad idea to mark overriden member as obsolete.

Atsushi Eno

Gert Driesen wrote:
> Hi,
> 
> I noticed that very recently CS0809 was added to mcs, which warns against an
> obsolete member that overrides a non-obsolete member.
> 
> This warning does not exist in csc (1.x and 2.x), and so I wonder why this
> was added.  Is it considered a bad practice to mark a member obsolete in a
> derived class ?
> 
> Gert
> 
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
> 




More information about the Mono-devel-list mailing list