How to move an associative array between modules?

H. S. Teoh hsteoh at quickfur.ath.cx
Fri Jan 12 20:52:07 UTC 2018


On Fri, Jan 12, 2018 at 08:46:50PM +0000, WhatMeWorry via Digitalmars-d-learn wrote:
[...]
> I hate to keep being a bother, but my project with the below static
> this() now compiles fine, but aborts during runtime with a "a problem
> caused the program to stop working ..."

Is there a way to get at the actual error message? That would be
immensely more helpful in diagnosing the problem.

One potential pitfall of static this(), though unlikely given your
circumstances, is if there are multiple modules that use static this()
and there's a circular dependency somewhere.  If this is the problem,
splitting the static this() into a separate module may help.

If all else fails, you *could* just move the initialization code into
main() (or a function called by main()).  It's uglier, but should get
things going again until you have more time to investigate how to fix
the problem.


T

-- 
Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald Knuth


More information about the Digitalmars-d-learn mailing list