Why do you continue to use D?

Timon Gehr timon.gehr at gmx.ch
Tue Jun 9 18:47:13 UTC 2020


On 6/9/20 8:12 PM, 12345swordy wrote:
> On Tuesday, 9 June 2020 at 16:43:21 UTC, Timon Gehr wrote:
>> On 09.06.20 17:45, 12345swordy wrote:
>>> On Tuesday, 9 June 2020 at 15:29:39 UTC, Timon Gehr wrote:
>>>> [...]
>>>
>>> This is the first bug that I had encounter first hand when 
>>> programming in d. An bug that hasn't been fixed in years!
>>>
>>> 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.
>>>
>>> The fix itself is heavily inspired by c# language.
>>> https://docs.microsoft.com/en-us/dotnet/api/system.idisposable.dispose?view=netcore-3.1 
>>>
>>>
>> I don't think that's necessary. Destructors should just inherit the 
>> base class destructor's attributes, then `destroy` can annotate itself 
>> with appropriate attributes.
>>
>> Also see: https://issues.dlang.org/show_bug.cgi?id=20914
> Which in order for that to happen it needs to be virtual function, not a 
> static function.

No, that's also not necessary. You can inherit attributes without making 
the function defined by the destructor function declaration virtual. 
__xdtor still needs to be virtual, but that appears to be the case already.


More information about the Digitalmars-d mailing list