http://d.puremagic.com/issues/show_bug.cgi?id=5143

           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
        AssignedTo: nob...@puremagic.com
        ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 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: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to