https://dlang.org/spec/hash-map.html#static_initialization:

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

==> Error: non-constant expression `["foo":5L, "bar":10L, "baz":2000L]`

Also: I don't understand the error message:
* What is non-constant in the *expression*?
* And why should it be constant at all?
(Removing "immutable" does not help...)

diniz

Reply via email to