--- Comment #2 from Matt Peterson <> 2012-04-14 21:09:04 
PDT ---
Jan: If you want tst to be compile time, use enum instead of const, and just do
"enum uint tst = 0;" or even "enum tst = 0;". The module constructor (static
this() {...}) is called at runtime, and can do a variety of things, including
getting input from the console and other things that the compiler can't
evaluate at compile time. Since you didn't give a value at the declaration of
tst, D requires you to set it in the module constructor as you have done, but
it's not a value that can be read at compile time. I believe if you were to
have done "static const uint tst = 0;" instead, it would have worked, but using
enum instead is a good way to force a variable to be compile time evaluated.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to