how to avoid "cycle detected"?

Jonathan M Davis via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jul 1 15:25:37 PDT 2015


On Wednesday, July 01, 2015 08:52:38 Steven Schveighoffer via Digitalmars-d-learn wrote:
> The runtime cannot introspect the code to detect the circular
> dependency, so it makes a conservative decision. I'm waiting on an
> introduction of RTInfo for modules [1] to allow us to mark static ctors
> as standalone, then we can probably fix this problem through a sort of
> "trust the programmer" mechanism.

I wouldn't mind that, but Walter shot that idea down previously when I was
arguing for adding a way to the language to tell the compiler that a static
constructor didn't depend on anything else. He didn't want a "trust the
programmer" mechanism in this case. I don't remember what his arguments were
though.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list