Hello List:

On my box, the following D source, inspired by the subsection 5.6.1 of tDpl,
does not work as expected:

-----------------------------------------------------------------
// adhoc_06.d

import std.stdio;

unittest {
        // Tersest, most convenient code
        auto f = (int i) {};
        writeln(typeid(f));
        assert(is(f == function));
        }

void main() {}
-----------------------------------------------------------------

I get:

void delegate()
core.exception.AssertError@adhoc_06.d(7): unittest failure


According to the book, the assertion is true and f is a function
but not a literal.

What is going wrong ?

Thanks in advance,
Jerome

Reply via email to