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

Alexander <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #2 from Alexander <[email protected]> ---
void testf(){}

void main()
{
    static assert(!is(testf == function));        // OK
    static assert(is(typeof(testf) == function));    // OK
    static assert(is(typeof( (){} ) == delegate));    // fails
}

But "is" doesn't work with function literals themselves in the first place, it
is intended to check whether type is equivalent to function pointer or not.

Same goes for:

static if (is(typeof((int, float){}) P == function))
    pragma(msg, P);
else
    static assert(0);    // fails

--

Reply via email to