Cyclic depency with class static ctor

Frank Benoit (keinfarbton) benoit at tionex.removethispart.de
Thu Oct 26 15:09:15 PDT 2006


I have project with many classes which also sometimes have static ctors.
Now I get the runtime error "cyclic dependency in module ...".

Is that a bug in the d runtime system, or is it just not documented,
that this runtime error is also possible for static ctors?

Now I have these 300+ ported classes, in 300+ modules. And they import
each other and many of them have a static ctor. What can I do? How can I
resolve the problems?

I can think of the possibility to replace all "static this()" with a
"public static void static_this()" and make a global module where i call
all these ctor in a manual defined order. Is that the way to go?



More information about the Digitalmars-d mailing list