link error for 2+ static this()

Johan Granberg lijat.meREM at OVEgmail.com
Wed Jun 7 07:49:09 PDT 2006


Derek Parnell wrote:
> It doesn't for me. I thought that meant that if one has more than one 
> static constructor in a module then they run in lexical order. For 
> example ....
> ...
> --Derek Parnell
> Melbourne, Australia

Ok in that case dmd and gdc have implemented this differently

this code compiled with gdc-0.18

//begin test.d
uint a=0,b=0;
static this()
{
	a=1;
}
static this()
{
	b=2;
}
void main()
{
	printf("%i, %i\n",a,b);
}
//end test.d
prints this
1, 2



More information about the Digitalmars-d-bugs mailing list