the override keyword

Stewart Gordon smjg_1998 at yahoo.com
Mon Nov 5 17:25:03 PST 2007


"Frank Benoit" <keinfarbton at googlemail.com> wrote in message 
news:fglj0h$8np$1 at digitalmars.com...
> Can we make the override keyword also be needed for implementing an
> interface function.
> This is not exactly overriding, but the purpose is the same. I want to
> write the keyword to say "Mr Compiler, check the override/implementing
> rules for a definition in the superclass or an interface! If the sig
> doens't match one, give error.".

I'm not sure about this.  If the base class and an implemented interface 
both have methods with the same name but different signatures, it could lead 
to a situation where you intended to override a method from the base class, 
and used the override keyword to try to check for this, but ended up 
implementing an interface method instead.  Or vice versa.

> Another feature request here is:
> The message "cannot instanciate abstract class XYZ..." is not so
> helpful. Please give a tip, of at least one missing implementation.
<snip>

Been proposed several times.

http://d.puremagic.com/issues/show_bug.cgi?id=204

Though personally, I'd like a requirement that abstract classes be declared 
with the abstract keyword like in Java.

Stewart.

-- 
My e-mail address is valid but not my primary mailbox.  Please keep replies 
on the 'group where everybody may benefit. 




More information about the Digitalmars-d mailing list