www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6958] New: [CTFE] closures are not yet supported in CTFE

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

           Summary: [CTFE] closures are not yet supported in CTFE
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: clugdbug yahoo.com.au



Test case:
-----------------------
int delegate(int a) bar6958(int x)
{
    int y = x;
    int delegate (int a) xxx = (int a){ return a + y; };
    return xxx;
}

int foo6958()
{
    auto z = bar6958(4);
    assert(z(3) == 7);
    return 3;
}

static assert(foo6958());

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 16 2011