Example program: --- import std.typecons, std.array; bool destroyed; struct Probe { ~this() { destroyed=true; } } void main() { { Nullable!(Probe[1]) example = staticArray([Probe()]); destroyed = false; } assert(destroyed); } --- The `Probe` instance inside `example` should have its destructor called when `example` goes out of scope. Since it does not, the assertion fails.
@pbackus created dlang/phobos pull request #7851 "Fix Issue 21704 - Nullable fails to destroy static array elements" fixing this issue: - Fix Issue 21704 - Nullable fails to destroy static array elements https://github.com/dlang/phobos/pull/7851
dlang/phobos pull request #7851 "Fix Issue 21704 - Nullable fails to destroy static array elements" was merged into master: - a56cc192bb635d3baa2e5b77976f4cec27169a6a by Paul Backus: Fix Issue 21704 - Nullable fails to destroy static array elements https://github.com/dlang/phobos/pull/7851