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

Basile-z <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #6 from Basile-z <[email protected]> ---
In a way the message about "this" is not bogus. It has not been mentioned but
if you set func "static" then the code works.

===
struct S
{
    int i;
}

void main()
{
    foreach(memberName; __traits(allMembers, S))
        func!(__traits(getMember, S, memberName));
}

static void func(alias member)()
{
    auto protection = __traits(getProtection, member);
    alias Type = typeof(member);
    auto name = __traits(identifier, member);
}
===

The real bug is that "func" seems to be injected in "S" (or considered as
member of) for some reasons.

--

Reply via email to