[Issue 5753] Disallow map() of void function

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Dec 21 01:02:34 PST 2015


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

Ryuichi OHORI <r.97all at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |r.97all at gmail.com
         Resolution|FIXED                       |---

--- Comment #7 from Ryuichi OHORI <r.97all at gmail.com> ---
It seems that void lambda is not disallowed. DMD2.069 compiles the code below,
which I think must not:

void f(T)(T x){}

unittest
{
    import std.algorithm : map;
    static assert (!__traits(compiles, [1].map!f));
    static assert ( __traits(compiles, [1].map!(e => f(e))));
}

--


More information about the Digitalmars-d-bugs mailing list