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

          Issue ID: 21432
           Summary: [CTFE] Cannot declare enum array in function scope
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Keywords: CTFE, rejects-valid
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: [email protected]
          Reporter: [email protected]

auto foo() {
    enum int[] a = [];
    return a;
}

enum a = foo;

void main() {
}


onlineapp.d(4): Error: declaration (enum int[] a = [];) is not yet implemented
in CTFE
onlineapp.d(8):        called from here: foo()

Compiles if the declaration is moved out of the function or the array type is
omitted.

--

Reply via email to