[Issue 17401] type inference broken when F and Parameters!F are used

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue May 16 00:02:02 PDT 2017


https://issues.dlang.org/show_bug.cgi?id=17401

Vladimir Panteleev <thecybershadow at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |thecybershadow at gmail.com

--- Comment #2 from Vladimir Panteleev <thecybershadow at gmail.com> ---
Mixing IFTI arguments and arguments derived from IFTI arguments is currently
not supported. (It was surely reported before in another issue.)

A workaround is:

    void wrap5(F, Args...)(F fn, Args args) if (is(Args == Parameters!F)) {}
    wrap5(&f, x);

> void f(ref int x) {}
> int x;
> wrap1(&f, x);   // void function(int) != void function(ref int)

Just for ref, "auto ref" usually suffices.

BTW, I noticed you added the industry keyword. If you haven't already, consider
adding your company to http://dlang.org/orgs-using-d.html.

--


More information about the Digitalmars-d-bugs mailing list