https://issues.dlang.org/show_bug.cgi?id=23951
Issue ID: 23951
Summary: "alias this" not properly dereferenced when the object
being looked up is a field of a type
Product: D
Version: D2
Hardware: All
URL: http://dlang.org/
OS: All
Status: NEW
Severity: major
Priority: P3
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
struct S { int x; }
struct T { S a; alias a this; }
struct U { T t; }
static assert(__traits(hasMember, T, "x"));
static assert(__traits(hasMember, T.init, "x"));
static assert(__traits(hasMember, U.init.t, "x"));
static assert(__traits(hasMember, U.t, "a"));
static assert(__traits(hasMember, U.t, "x")); // only assertion that fails!
if U.t has a type (T), then it should also have access to "x", in the same way.
--