[Issue 1499] New: __trais: iterating over __traits(allMembers, ...) with extern attributes does not compile

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Sep 13 08:36:40 PDT 2007


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

           Summary: __trais: iterating over __traits(allMembers,...) with
                    extern attributes does not compile
           Product: D
           Version: 2.004
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: jascha at mainia.de


traits.d(12): variable traits.main.m voids have no value
traits.d(12): Error: foreach: void[0u] is not an array of int

it compiles fine if "extern(Windows):" is omitted or non-extern declarations
are added. in the latter case, the extern-members are not listed, though.

#line 1
import std.stdio;

interface D
{
extern(Windows):
    void foo();
    int foo(int);
}

void main()
{
    foreach ( m; __traits(allMembers, D) )
        writefln(m);
}


-- 



More information about the Digitalmars-d-bugs mailing list