[Issue 21482] dynamic indexing into enum dynamic array at ctfe generates TypeInfo in betterC

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Dec 15 01:30:29 UTC 2020


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

--- Comment #1 from dave287091 at gmail.com ---
I have discovered that a workaround is as follows:


int f_4(int a){
    enum int[]foo_ = [1,2,3];
    enum int[foo_.length]foo = foo_;
    if(__ctfe)
        return foo[a];
    return 4;
}

--


More information about the Digitalmars-d-bugs mailing list