http://d.puremagic.com/issues/show_bug.cgi?id=7608

           Summary: __traits(allMembers) is broken for template instances
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: andrej.mitrov...@gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrov...@gmail.com> 2012-02-29 
03:08:58 PST ---
import std.stdio;

struct Base(bool T)
{
    static if (T)
    {
        int x;
    }

    int y;
}

void main()
{
    alias Base!false Type;
    auto fields = [__traits(allMembers, Type)];

    writeln(fields);  // writes ["x", "y"]
}

"x" does not exist in the Base!false instance.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to