[Issue 4844] New: _traits(allMembers, X) ignores version guards inside X

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Sep 9 08:10:15 PDT 2010


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

           Summary: _traits(allMembers, X) ignores version guards inside X
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: andrei at metalanguage.com


--- Comment #0 from Andrei Alexandrescu <andrei at metalanguage.com> 2010-09-09 08:09:51 PDT ---
Consider:

import std.stdio;

struct A
{
    version (none)
    {
        int x;
    }
    else
    {
        int y;
    }
    int z;
}

void main()
{
    foreach (s; __traits(allMembers, A))
        writeln(s);
}

Surprisingly, this prints

x
z

although version "none" is not defined.

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


More information about the Digitalmars-d-bugs mailing list