Follwing should compile, but can't. template Hoge() { immutable static int[int] dict; immutable static int value; static this() { dict = [1:1, 2:2]; value = 10; } } alias Hoge!() H;
https://github.com/D-Programming-Language/dmd/pull/392
https://github.com/D-Programming-Language/dmd/commit/6fd9beafb3c7ff9dff71e3499ee404818d1e0aea
Keep in mind that there are cases more important than this one that currently don't work: struct Foo { immutable int[1] arr; this(int x) { arr[0] = 1; } } auto f = Foo(1); void main() {}