[Issue 9423] New: Missed conversion of lambda literal with ref argument

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 29 02:51:31 PST 2013


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

           Summary: Missed conversion of lambda literal with ref argument
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2013-01-29 02:51:30 PST ---
void foo(int delegate(ref int[1]) spam) {}
void main() {
    foo((ref int[1] x) => 0); // OK
    foo(x => 0); // Error
}



DMD 2.062alpha gives:

test.d(4): Error: function test.foo (int delegate(ref int[1u]) spam)(null) is
not callable using argument types (void)
test.d(4): Error: cannot implicitly convert expression (__lambda3) of type int
delegate(int[1u] x) pure nothrow @safe to int delegate(ref int[1u])

-- 
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