You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For reference, the spec describes lazy variadic functions here:
http://dlang.org/spec/function.html#lazy_variadic_functions
The test case doesn't need the template parameters to fail. This fails, too:
----
void all()(void delegate()[] dgs ...) {}
void f() {}
void main() { all(f()); } /* Error: template test.all cannot deduce function from argument types !()(void) */
----
It works when the return type is int or another primitive type, including pointers and arrays:
----
void all()(int delegate()[] dgs ...) {}
int f() { return 0; }
void main() { all(f()); } /* no error */
----
But it fails with Object and user-defined aggregates. Most peculiarly, it also fails with an alias to a primitive type:
----
alias T = int;
void all()(T delegate()[] dgs ...) {}
T f() { return T.init; }
void main() { all(f()); } /* Error: template test.all cannot deduce function from argument types !()(int) */
----
Mario Kroeplin reported this on 2016-08-01T09:12:44Z
Transferred from https://issues.dlang.org/show_bug.cgi?id=16345
CC List
Description
The text was updated successfully, but these errors were encountered: