Bug 9109 – Regression: 2.053: Lazy Variadic Functions do not work with delegates
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-12-02T17:17:00Z
Last change time
2012-12-03T16:03:29Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
andrej.mitrovich
Comments
Comment #0 by andrej.mitrovich — 2012-12-02T17:17:24Z
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