[Issue 1578] Allow AA literals to initialize static variables

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Apr 12 21:42:02 UTC 2021


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

mw <mingwu at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mingwu at gmail.com

--- Comment #6 from mw <mingwu at gmail.com> ---
(In reply to Don from comment #2)
> Reduced test case:
>  
> static int sizemap[int]= [0:0, 1:1, 2:4, 3:8, 4:8, 4:16];
> 
> changed title from "const initializer rejected".

The work-around is:

enum int[int] sizemap= [0:0, 1:1, 2:4, 3:8, 4:8, 4:16];


BTW, this is a very old issue, if it's not intended to be fixed, can we add to
the doc, and close it?

--


More information about the Digitalmars-d-bugs mailing list