When a type T is declared as const, Unqual!T is not T, or perhaps more correctly, T is not T, but const(T). Confusing enough yet? Have a look-see: import std.traits : Unqual; const struct T { } pragma(msg, T); // const(T) pragma(msg, Unqual!T); // T static assert(!is(T == Unqual!T));
I don't see any issue here because static assert(is(T == const) && !is(T == Unqual!T)); is perfectly logic.