On Thursday, 11 January 2018 at 23:20:44 UTC, WhatMeWorry wrote:
When I simply move the array out of main() but still in app.d, the compiler returns Error: expression ["SCRATCH":Track("scratch.wav", cast(Sound)1, 0, null),... is not a constant.

Can I use "static if" or "static this()", or "mixin" or some other technique?

Yeah, just declare the array outside, then initialize it inside a static this() constructor.

int[int] foo;
static this() {
  foo = [1:1];
}

Reply via email to