D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7168 - Regression(2.057) __traits(allMembers) returns wrong tuple
Summary: Regression(2.057) __traits(allMembers) returns wrong tuple
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 regression
Assignee: No Owner
URL:
Keywords: patch, wrong-code
Depends on:
Blocks:
 
Reported: 2011-12-27 01:08 UTC by Kenji Hara
Modified: 2011-12-31 18:09 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Kenji Hara 2011-12-27 01:08:23 UTC
class X
{
    void foo(){}
}
class Y : X
{
    void bar(){}
}

enum ObjectMems = ["toString","toHash","opCmp","opEquals","Monitor","factory"];

static assert([__traits(allMembers, X)] == ["foo"]~ObjectMems);        // pass
static assert([__traits(allMembers, Y)] == ["bar", "foo"]~ObjectMems); // fail
static assert([__traits(allMembers, Y)] != ["bar", "foo"]);            // fail

This bug was introduced by merging pull #437.

D2 branch commit:
https://github.com/D-Programming-Language/dmd/commit/87682481da9cbbe2715a81edbdc76c0735f644f6

D1 branch commit:
https://github.com/D-Programming-Language/dmd/commit/191ddb032a64cf278b6890ebc72b6d0135428d62
Comment 2 Kenji Hara 2011-12-27 07:31:41 UTC
Sorry, D1 does not have __traits.
So this is D2 only issue.