order of static constructor execution

bearophile bearophileHUGS at lycos.com
Thu Mar 11 18:53:15 PST 2010


Walter Bright:
> 1. Attempt the depth-first traversal of the static constructors.
> 2. If a loop is detected, rather than issuing an error message, simply 
> arbitrarily pick one order and continue constructing.

Some alternative possibilities:
- Issue a warning too?
- Or allow that only if the code is compiled with "-allowloops"?
- Or accept one specific loop only if the programmer somewhere states explicitly that this loop is OK, and issue an error otherwise?

Bye,
bearophile



More information about the Digitalmars-d mailing list