I had a set of default error messages to go with error code numbers, and did something along the lines of:

string[uint] error_text = [
    400: "A message",
    401: "A different message"
];

and got "expression .... is not a constant"

I eventually found this discussion:
    https://issues.dlang.org/show_bug.cgi?id=6238

I understand that it's problematic, but a message which makes it clearer that compile-time initialization of global AA's are not supported? Because it cost me about a half hour trying to figure out what I was doing wrong.

(My workaround was to initialize the data structure once during app startup.)

Reply via email to