lib.d: ---- import std.stdio; template T() { static this() { writefln("A"); } } mixin T; mixin(q{ static this() { writefln("B"); } }); static this() { writefln("C"); } ---- test.d: ---- import lib; void main() { import std.stdio; writefln("You should see ABC above."); } ---- Compile the above files with the following: $ dmd -lib lib.d $ dmd test.d lib.a The first static constructor (A) is not executed when lib.d is a library. Note that when compiled with `dmd test.d lib.d` this works as expected. Tested on Linux32 and OSX32 with dmd 2.056. This worked in previous releases, it is currently broken (not sure when it broke).
Happens on Windows as well. This isn't a regression, it behaves the same way in D 1.040. It has never worked.
(In reply to comment #1) > Happens on Windows as well. This isn't a regression, it behaves the same way in > D 1.040. It has never worked. I have no idea how my code used to work then. Weird.
I can't reproduce this on recent D2 (2.067 HEAD win32)
D1 is no longer supported, closing as WORKSFORME.