On Thursday, 3 March 2016 at 10:01:47 UTC, MGW wrote:
immutable long[string] aa = [
   "foo": 5,
   "bar": 10,
   "baz": 2000
];

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

I'm not sure there's a way around this except by initialising it at runtime. So you can't get it in the rom segment.

immutable long[string] aa;

shared static this() {
    aa = [
        "foo": 5,
        "bar": 10,
        "baz": 2000
    ];
}

Reply via email to