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

           Summary: Function literal does not convert to "function" and
                    "delegate" types
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: [email protected]
        ReportedBy: [email protected]


--- Comment #0 from Andrei Alexandrescu <[email protected]> 2011-09-22 
07:31:43 PDT ---
Consider:


void foo (int function (int, int) a){}
void bar (int delegate (int, int) a){}

void main ()
{
    foo((a, b) { return a +b;});
    bar((a, b) { return a +b;});
}

Neither call works. The literal does not convert to the function or the
delegate type.

Additionally (this might have been reported), a function type should convert
automatically to a delegate type with the same arguments and return type.
Walter has expressed doubts about that. The doubts are unfounded.

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

Reply via email to