Why is local struct visible in this outer template, while local class is not?

https://wandbox.org/permlink/MfsDa68qgaMSIr4a

https://dlang.org/spec/template.html#instantiation_scope

---

enum p(T) = __traits(compiles, new T());

class GlobalC {}
struct GlobalS {}

void main()
{
    class LocalC {}
    static assert(p!GlobalC);
    static assert(!p!LocalC);

    struct LocalS {}
    static assert(p!GlobalS);
    static assert(p!LocalS); // ??
}

Reply via email to