xxxxxxxxxx
module test.foo;
pragma(msg, __traits(identifier, test.foo)); // "foo"
pragma(msg, __traits(compiles, __traits(identifier, test.foo))); // true
static assert(__traits(compiles, __traits(identifier, test.foo))); // passes
static if (__traits(compiles, __traits(identifier, test.foo))) // fails
{
pragma(msg, "Never gets here");
}
else
{
static assert(0);
}
void main() {}