https://issues.dlang.org/show_bug.cgi?id=19786
Issue ID: 19786 Summary: alias to __traits(getMember) wrongfully always binds to this Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: enhancement Priority: P1 Component: dmd Assignee: nob...@puremagic.com Reporter: edi33...@gmail.com Give the following code example ``` struct S { void foo(const ref S rhs) { alias thisMember = __traits(getMember, this, "x"); alias rhsMember = __traits(getMember, rhs, "x"); pragma(msg, thisMember.stringof); pragma(msg, rhsMember.stringof); pragma(msg, __traits(getMember, rhs, "x").stringof); } int x; } ``` This outputs ``` this.x this.x rhs.x ``` As you can see, `rhsMember.stringof` evaluates to `this.x` instead of `rhs.x` --