www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4844] New: _traits(allMembers, X) ignores version guards inside X

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: andrei metalanguage.com


--- Comment #0 from Andrei Alexandrescu <andrei 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: -------
Sep 09 2010
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4844


Benjamin Thaut <code benjamin-thaut.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |code benjamin-thaut.de


--- Comment #1 from Benjamin Thaut <code benjamin-thaut.de> 2012-09-04 13:02:17
PDT ---
Any update on this? I just ran into the exact same issue.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 04 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4844


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |andrej.mitrovich gmail.com
         Resolution|                            |FIXED


--- Comment #2 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2012-12-20
13:22:58 PST ---
Fixed since at least 2.060

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