www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - improving "cannot create instance of abstract class ..."

reply Frank Benoit <keinfarbton nospam.xyz> writes:
Would be nice if this message could also give a hint, why this class is
abstract.

"cannot create instance of abstract class 'abc'. Method 'func' of
interface 'MyInterface' is not implemented."
May 04 2006
next sibling parent reply Tydr Schnubbis <fake address.dude> writes:
Frank Benoit wrote:
 Would be nice if this message could also give a hint, why this class is
 abstract.
 
 "cannot create instance of abstract class 'abc'. Method 'func' of
 interface 'MyInterface' is not implemented."
That last sentence in the error message looks like a pretty good hint to me. You need to implement 'func', with the same signature as in MyInterface.
May 04 2006
parent Frank Benoit <keinfarbton nospam.xyz> writes:
Tydr Schnubbis schrieb:
 Frank Benoit wrote:
 Would be nice if this message could also give a hint, why this class is
 abstract.

 "cannot create instance of abstract class 'abc'. Method 'func' of
 interface 'MyInterface' is not implemented."
That last sentence in the error message looks like a pretty good hint to me. You need to implement 'func', with the same signature as in MyInterface.
Oh, i was not clear. The message in the subject is the one from the compiler. The one with the hint is my suggestion. So it looks pretty good for me also :)
May 04 2006
prev sibling parent Serg Kovrov <kovrov bugmenot.com> writes:
Frank Benoit wrote:
 Would be nice if this message could also give a hint, why this class is
 abstract.
 
 "cannot create instance of abstract class 'abc'. Method 'func' of
 interface 'MyInterface' is not implemented."
I have run in similar situation today - search for unimplemented method in class hierarchy. It happen not often, but always painful and time consuming. It had passed more than a year now. Seems nothing changed. Any chances to have such hints anytime soon? -- serg.
Jun 28 2007