map.d(165): cannot create instance of abstract class Droid Please add info about method which isn't implemented yet: "because XXX is abstract" or smth. If many - the first one is good enought.
To show the issue more clearly: -- class Foo { abstract void foo(); } class Bar : Foo {} void main() { Bar bar = new Bar(); } -- The code fails with "cannot create instance of abstract class Bar". What is being asked for is an error message which would, in this instance, clarify that the reason the instantiation fails is that the method foo() is unimplemented in Bar.
I think this is an important usability/productivity issue. Althought I don't know the internals of the DMD compiler, I would expect the compiler to know what is missing before deciding it can't create an instance. Therefore it should be a simple matter to add that information to the error message. In addition, I think this gives DMD, and hence the D language, a feeling of incompleteness. Something which may be a hinderance to wider usage.
This is represented by dstress test: http://dstress.kuehne.cn/nocompile/a/abstract_14.d
// __DSTRESS_ELINE__ 19 Why line 19? Why not 16, where the abstract method is declared?
(In reply to comment #4) > // __DSTRESS_ELINE__ 19 > > Why line 19? Why not 16, where the abstract method is declared? I'd prefer both: 16 to indicate *which* abstract method isn't declared, and 19 to indicate *where* it isn't declared.
(In reply to comment #5) > (In reply to comment #4) > > // __DSTRESS_ELINE__ 19 > > > > Why line 19? Why not 16, where the abstract method is declared? > > I'd prefer both: 16 to indicate *which* abstract method isn't declared, and 19 > to indicate *where* it isn't declared. s/declared/implemented/g (For the less sed-aware: replace both instances of "declared" in above comment with "implemented")
Fixed in 1.024.
Fixed dmd 1.024 and 2.008
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル