[Issue 9109] New: Regression: 2.053: Lazy Variadic Functions do not work with delegates

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Dec 2 17:17:27 PST 2012


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

           Summary: Regression: 2.053: Lazy Variadic Functions do not work
                    with delegates
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: andrej.mitrovich at gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2012-12-02 17:17:24 PST ---
Taken from spec: dlang.org/function.html section Lazy Variadic Functions

void foo(int delegate()[] dgs ...) { }

void main()
{
    int x;
    int delegate() dg;
    foo( { return 1; }, { return 3+x; }, dg, null);
}

2.053: ok

2.054: Error: function test.foo (int delegate()[] dgs...) is not callable using
argument types (int delegate() pure nothrow,int delegate() nothrow,int
delegate(),void*)

...

2.060 has gotten even worse:

test.d(7): Error: function test.foo (int delegate()[] dgs...) is not callable
using argument types (int function() pure nothrow @safe,int delegate() nothrow
@safe,int delegate(),typeof(null))
test.d(7): Error: cannot implicitly convert expression (__lambda1) of type int
delegate() pure nothrow @safe to int
test.d(7): Error: cannot implicitly convert expression (__lambda2) of type int
delegate() nothrow @safe to int
test.d(7): Error: cannot implicitly convert expression (null) of type
typeof(null) to int

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