The situation is like this.(dmd 2.058) ==================== libtest.d -------------------- template typestring( T ) { string typestring = T.stringof; static this() { assert(0); } } alias typestring!int ti; -------------------- >dmd -lib -H libtest.d test.d -------------------- import std.stdio; import libtest; // <- libtest.di is imported. pragma( lib, "libtest.lib" ); alias typestring!uint tui; //mixin typestring!uint tui; // it is no matter, alias or mixin. void main() { //writeln( ti); // <- uncomment to Assertion failure writeln( tui ); // <- with no Assertion failure, "uint" is printed. } -------------------- >dmd test.d >./test.exe >uint ==================== When libtest.d is imported, or when I write the body code of the static this() to libtest.di, assertion failure occur.
*** This issue has been marked as a duplicate of issue 7754 ***