On Thursday, 14 March 2019 at 14:22:52 UTC, spir wrote:
https://dlang.org/spec/hash-map.html#static_initialization:

immutable long[string] aa = [
  "foo": 5,
  "bar": 10,
  "baz": 2000
];

If I'm right, you can't use this syntax with global array. Insted this works:

void main()
{
  immutable long[string] aa = [
    "foo": 5,
    "bar": 10,
    "baz": 2000
  ];
}

You should init global AAs using static this() { } as explained in the same doc

Andrea

Reply via email to