Re: Issue with module destructor order

2012-05-23 Thread Martin Nowak
mixin template logIt() { static shared this() { log(typeof(this).stringof ~ init); } static shared ~this() { log(typeof(this).stringof ~ deinit); } } Try shared static this() and it won't run as a class constructor. http://dlang.org/class.html#StaticConstructor

Re: Issue with module destructor order

2012-05-23 Thread Martin Nowak
mixin template logIt() { static shared this() { log(typeof(this).stringof ~ init); } static shared ~this() { log(typeof(this).stringof ~ deinit); } } Try shared static this() and it won't run as a class constructor. http://dlang.org/class.html#StaticConstructor

Re: Issue with module destructor order

2012-04-08 Thread Benjamin Thaut
Created bug ticket: http://d.puremagic.com/issues/show_bug.cgi?id=7855 -- Kind Regards Benjamin Thaut

Re: Issue with module destructor order

2012-04-08 Thread Kevin Cox
On Mar 26, 2012 5:11 AM, Benjamin Thaut c...@benjamin-thaut.de wrote: Is this intended behaviour or is this a bug? I assume this happens because of the mixin template and the public import. I'm using dmd 2.058. -- Kind Regards Benjamin Thaut I don't think the order of destructors is

Re: Issue with module destructor order

2012-04-08 Thread Timon Gehr
On 04/08/2012 02:14 PM, Kevin Cox wrote: On Mar 26, 2012 5:11 AM, Benjamin Thaut c...@benjamin-thaut.de mailto:c...@benjamin-thaut.de wrote: Is this intended behaviour or is this a bug? I assume this happens because of the mixin template and the public import. I'm using dmd 2.058. --

Issue with module destructor order

2012-03-26 Thread Benjamin Thaut
Hi, I came across a issue with the order in which druntime calls the module destructors. I created a small repro case for it: file a.d: module a; import logger; shared static this() { log(a init); } shared static ~this() { log(a deinit); } file b.d: module b; import mix; class Foo {