[Issue 19079] Destructors not called in named unions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jul 30 06:14:58 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=19079

Simen Kjaeraas <simen.kjaras at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |spec

--- Comment #1 from Simen Kjaeraas <simen.kjaras at gmail.com> ---
As mentioned in issue 19122, and quoting from
https://github.com/dlang/dmd/pull/5830:

"Unrestricted unions can have fields that have destructors, postblits, or
invariants. It's up to the user to call them correctly, the compiler does not
automatically generate calls to them."

So this is actually expected behavior in unions, and the spec is wrong.

--


More information about the Digitalmars-d-bugs mailing list