www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16390] New: __traits not accepted where a type is expected

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 puremagic.com
          Reporter: lodovico giaretart.net
                CC: lodovico 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];
}

--
Aug 15 2016