[Issue 1578] Allow AA literals to initialize static variables

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Apr 12 22:09:58 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=1578

--- Comment #7 from Ethan Watson <gooberman at gmail.com> ---
(In reply to mw from comment #6)
> The work-around is:
> 
> enum int[int] sizemap= [0:0, 1:1, 2:4, 3:8, 4:8, 4:16];

That's not a workaround *at all*. That's defining a constant. My example from
2018 even illustrates exactly this, and that assigning the constant to a static
variable does not work.

--


More information about the Digitalmars-d-bugs mailing list