On Wednesday, 19 July 2017 at 07:48:28 UTC, Danni Coy wrote:
Is there a reason that the following codestruct Foo { this (string name) { do_something(name); } ~this() { undo_something(); } } Foo foo = void; void open() { foo = Foo("test"); // <- this line } tries to OpAssign foo to itself then calls foo's destructor?
What happens is this. void open() { foo = () { Foo _tmp = Foo.__ctor("test"); return _tmp; } (); }