| Thread overview | ||||||
|---|---|---|---|---|---|---|
|
April 02, 2016 Any reason as to why this isn't allowed? | ||||
|---|---|---|---|---|
| ||||
class C {
~this() {}
immutable ~this() {}
}
This gives a conflict error between the two destructors.
| ||||
April 02, 2016 Re: Any reason as to why this isn't allowed? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Lass Safin | 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 Re: Any reason as to why this isn't allowed? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Paul O'Neil | 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 Re: Any reason as to why this isn't allowed? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Lass Safin | 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 | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply