← Back to index
|
Original Bugzilla link
Bug 2234 – __traits(allMembers) returns incorrect results for mixin and template alias members of an aggregate
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2008-07-18T10:04:00Z
Last change time
2014-02-15T02:44:50Z
Keywords
patch, spec, wrong-code
Assigned to
nobody
Creator
samukha
Comments
Comment #0
by samukha — 2008-07-18T10:04:58Z
1. Unnamed mixin ---- import std.stdio; template Foo() { int x; } struct S { mixin Foo; } void main() { writefln(__traits(allMembers, S)); } ---- Outputs [__T3FooZ] instead of the expected [x] 2. Multiple unnamed mixins --- template Foo() { int x; } struct S { mixin Foo; mixin Foo; } void main() { writefln(__traits(allMembers, S)); } ---- Outputs [__T3FooZ]. What's the expected output anyway? Could the name conflict be detected before the conflicted name is referenced? 3. Template alias ---- import std.stdio; template Foo() { int x; } struct S { alias Foo!() foo; } void main() { writefln(__traits(allMembers, S)); } ---- Outputs [foo __T3FooZ] instead of the expected [foo]
Comment #1
by mrjnewt — 2010-08-13T16:06:24Z
Updating as this is still broken in 2.048
Comment #2
by k.hara.pg — 2011-07-14T04:35:40Z
https://github.com/D-Programming-Language/dmd/pull/231
Comment #3
by bugzilla — 2011-08-12T22:38:18Z
https://github.com/D-Programming-Language/dmd/commit/ddfeba9ced58881a343d8392a42f6910339c441c