December 02, 2003
static constructor in other module's template never called. is it a bug or not?

--- other_module.d
template template_test(T) {
static this() { printf("static constructor\n"); }
class foo { static this() { printf("foo's static constructor\n"); } }
static foo t;
}

--- test.d
import other_module;
class foo {}

int main(){
instance template_test(foo) f;
while(1) {}
return 0;
}

/**
compiled with
dcd test.d other_module.d
in windows
*/


December 19, 2003
"yaneurao" <yaneurao_member@pathlink.com> wrote in message news:bqingn$2m7o$1@digitaldaemon.com...
> static constructor in other module's template never called. is it a bug or not?

Bug.