Summary: Static array of function literals
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from 2010-10-31 06:15:06 PDT ---
This code works correctly with DMD 2.050:

void f1(int a) {}
static void function(int a)[] foo = [&f1];
void main() {}

But this doesn't compile:

static void function(int a)[] foo = [function(int a) {}];
void main() {}

The error message:

test.d(1): Error: non-constant expression __funcliteral1

I think this second version of the code too is correct.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to