[Issue 6714] New: Function literal does not convert to "function" and "delegate" types

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Sep 22 07:32:11 PDT 2011


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: nobody at puremagic.com
        ReportedBy: andrei at metalanguage.com


--- Comment #0 from Andrei Alexandrescu <andrei at metalanguage.com> 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: -------


More information about the Digitalmars-d-bugs mailing list