On Wednesday, 27 January 2016 at 17:08:09 UTC, Andrei Alexandrescu wrote:
Interesting. It may be worked around, but is arguably a mistake in the language definition. Have you submitted an issue for this? -- Andrei

1) https://issues.dlang.org/show_bug.cgi?id=14246

Includes suggestion on how the compiler could handle it.

2) https://issues.dlang.org/show_bug.cgi?id=9704

Related issue with postblits.

3) https://issues.dlang.org/show_bug.cgi?id=2590

Here, Don suggests that it's not a bug because destructors should only run on fully constructed objects, referencing C++. However, IMO this is not a valid argument for D, as we have .init, which is always a valid state. It can still be debated whether the destructor of the failed object itself should run, but it should always be safe to run the destructors of members.

Reply via email to