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

          Issue ID: 17057
           Summary: trait "allMembers" incorrectly includes imports
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: [email protected]
          Reporter: [email protected]

For the following code:

class LeClass {
    import std.stdio;
}

void main() {
    foreach(member; __traits(allMembers, LeClass)) {
        pragma(msg, member);
    }
}

The compilation output will be:
std
toString
toHash
opCmp
opEquals
Monitor
factory

Note how "std" is there. This one is added due to the import statement being
there. This inclusion is unusable and incorrect since an import statement is
not a member of a class.

--

Reply via email to