link error for 2+ static this()

Johan Granberg lijat.meREM at OVEgmail.com
Wed Jun 7 05:34:27 PDT 2006


Carlos Santander wrote:
> Walter Bright escribió:
>> BCS wrote:
>>> this gives a link error with somthing about duplicate symbols.
>>>
>>> <code>
>>> void main(){}
>>> static this(){}
>>> static this(){}
>>> <\code>
>>
>> That's because there are two static constructors, which is not legal.
> 
> But it could be caught at compile time, instead, giving an appropriate 
> error message.
> 

quote from the spec
"Order of Static Construction within a Module

Within a module, the static construction occurs in the lexical order in 
which they appear."

doesn't this imply that multiple static constructors are legal?



More information about the Digitalmars-d-bugs mailing list