Why do you continue to use D?

Stanislav Blinov stanislav.blinov at gmail.com
Tue Jun 9 16:33:13 UTC 2020


On Tuesday, 9 June 2020 at 15:45:29 UTC, 12345swordy wrote:

> It can be fix by having the druntime providing a interface say 
> "Dispose" and just have the destroy function call that and 
> leave the old deconstructors alone.

There's no need for a new interface. What needs to happen is 
resolution of [1] and amendment to destroy() so it avoids 
rt_finalize and infers correct attributes. Which, even three 
years later, I maintain should be resolved by disallowing classes 
to loosen destructor attributes.

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

Until that happens, locally, in your own codebase, you can just 
have your own variant of destroy() that infers attributes as 
weakest of all in a given hierarchy. Provided you don't write 
classes that violate dtor attributes down the inheritance chain.
So at least this problem can be sidestepped, though I agree it 
should have a formal resolution in the language and the runtime 
library.


More information about the Digitalmars-d mailing list