[Issue 16390] New: __traits not accepted where a type is expected

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Aug 15 06:15:47 PDT 2016


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

          Issue ID: 16390
           Summary: __traits not accepted where a type is expected
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: spec
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: lodovico at giaretart.net
                CC: lodovico at giaretart.net

For example, this does not work:

template ParentType(T)
{
    alias ParentType = __traits(parent, T);
}

This leads to awkward workarounds:

template ParentType(T)
{
    alias ParentType = AliasSeq!(__traits(parent, T))[0];
}

--


More information about the Digitalmars-d-bugs mailing list