[Issue 19410] New: Inconsistency between __traits(allMembers) and __traits(hasMember) for nested structs
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Nov 18 10:42:22 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=19410
Issue ID: 19410
Summary: Inconsistency between __traits(allMembers) and
__traits(hasMember) for nested structs
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: stanislav.blinov at gmail.com
void main() {
struct S {
~this() {}
}
foreach (name; __traits(allMembers, S))
static assert(__traits(hasMember, S, name));
}
The above will assert: __traits(allMembers) reports that S has a member "this"
(the context pointer), but __traits(hasMember) insists that it doesn't.
Perhaps "this" could be renamed to "__context", and made visible to
__traits(hasMember)?
--
More information about the Digitalmars-d-bugs
mailing list