[Issue 15246] Destructor inheritance doesn't inherit attributes properly

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Oct 27 02:19:56 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=15246

--- Comment #4 from Marco Leise <Marco.Leise at gmx.de> ---
The destructors do *neither* inherit *nor* call their parent destructors. Not
as a matter of terminology, but because in D they are not called recursively,
but in sequence, starting from the runtime type's dtor and working its way up
the inheritance chain. Take a look at the druntime source I linked above and
you will understand what happens.

To make the bug report valid we would have to introduce destructor inheritance
to the language to begin with. Right now the only functions affected by the
destructor attributes would be the attribute-less external(C) functions
`rt_finalize` and `rt_finalize2`. (In client code we call `rt_finalize` as
`destroy(Object obj)` for deterministic object destruction).

--


More information about the Digitalmars-d-bugs mailing list