Thread overview
Any reason as to why this isn't allowed?
Apr 02, 2016
Lass Safin
Apr 02, 2016
Paul O'Neil
Apr 02, 2016
Lass Safin
Apr 04, 2016
Marco Leise
April 02, 2016
class C {
        ~this() {}
        immutable ~this() {}
}

This gives a conflict error between the two destructors.
April 02, 2016
On 04/02/2016 09:02 AM, Lass Safin wrote:
> class C {
>          ~this() {}
>          immutable ~this() {}
> }
>
> This gives a conflict error between the two destructors.

What do you expect the difference to be?  I'm not sure what I expect the semantics of destroying an immutable object to be.
April 02, 2016
On Saturday, 2 April 2016 at 16:58:14 UTC, Paul O'Neil wrote:
> On 04/02/2016 09:02 AM, Lass Safin wrote:
>> class C {
>>          ~this() {}
>>          immutable ~this() {}
>> }
>>
>> This gives a conflict error between the two destructors.
>
> What do you expect the difference to be?  I'm not sure what I expect the semantics of destroying an immutable object to be.

It's more that I wish the immutable destructor to be empty, thus never destroying it properly.

I just don't really see the reason as to why we can have immutable and mutable constructors but not immutable and mutable destructors.

Though currently it is possible if I create two functions, one immutable and one not, then set the value inside the vtable manually within two constructors, again, one immutable and one not.
April 04, 2016
Am Sat, 02 Apr 2016 13:02:18 +0000
schrieb Lass Safin <lasssafin@gmail.com>:

> class C {
>          ~this() {}
>          immutable ~this() {}
> }
> 
> This gives a conflict error between the two destructors.

That is https://issues.dlang.org/show_bug.cgi?id=13628

-- 
Marco