[Issue 23951] New: "alias this" not properly dereferenced when the object being looked up is a field of a type
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Jun 1 09:54:57 UTC 2023
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: nobody at puremagic.com
Reporter: eyal at weka.io
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.
--
More information about the Digitalmars-d-bugs
mailing list