Draft for DIP concerning destroy is up.

sarn sarn at theartofmachinery.com
Fri May 25 23:57:01 UTC 2018


On Friday, 25 May 2018 at 21:01:16 UTC, Mike Franklin wrote:
> On Friday, 25 May 2018 at 20:08:23 UTC, 12345swordy wrote:
>> https://github.com/dlang/DIPs/pull/120
>>
>> Feedback would be very appreciated.
>
> I was under the impression that Andrei's ProtoObject was 
> supposed to remedy that:  
> https://forum.dlang.org/post/pa1lg6$1lud$1@digitalmars.com
>
> Mike

It's not enough for destructors because they work "both ways".

If we have a universal base class with a @nogc destructor, then 
no subclass can have a non- at nogc destructor.  In particular, it 
won't be compatible with today's Object.  But if the universal 
base class has a destructor that's not @nogc, then classes can't 
ever be destroyed in @nogc code because destructors need to 
recurse to base class destructors.

I think we have to either give up on having a sole universal base 
class, or special-case destructors in the language (or some 
combination of both).


More information about the Digitalmars-d mailing list