This is bug or not? (immutable class containing struct with dtor)

Tejas notrealemail at gmail.com
Sat Dec 18 12:50:17 UTC 2021


On Saturday, 18 December 2021 at 11:01:53 UTC, Denis Feklushkin 
wrote:
> On Friday, 17 December 2021 at 19:03:05 UTC, Tejas wrote:
>
>> Well, I got completely mislead by my experiment 😓
>>
>> ```d
>> struct S
>> {
>>     ~this() immutable {}
>> }
>> ```
>
> Interesting what discussed behaviour isn't affects method what 
> implements same functionality as dtor and called explictly at 
> each appropriate place.
>
> So for dirty fix I just created
>
> ```d
>     void __custom_dtor() const
>     { ... }
> ```
>
> And then called this __custom_dtor at each dtor what uses this 
> struct.

As Ali said, this is an implementation issue.

So I guess the answer to your question is that this is a bug.

Please file a report at [issues.dlang.org](issues.dlang.org)


More information about the Digitalmars-d-learn mailing list