Bug 9178 – UDA: getAttributes does not play well with tupleof

Status
RESOLVED
Resolution
FIXED
Severity
blocker
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-12-18T09:18:00Z
Last change time
2013-01-19T11:05:07Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
puneet

Comments

Comment #0 by puneet — 2012-12-18T09:18:57Z
http://forum.dlang.org/thread/[email protected] I am trying to get the user defined attributes for all the fields of a class. I am getting the following error: Error: first argument is not a symbol tuple(false) // test code template Tuple(T...) { alias T Tuple; } enum Bar; class Foo { @Bar int a; } void main() { Foo foo = new Foo; alias Tuple!(__traits(getAttributes, foo.tupleof[0])) tp; pragma(msg, tp); }
Comment #1 by k.hara.pg — 2013-01-17T23:16:13Z
Comment #2 by doob — 2013-01-17T23:37:05Z
Awesome.
Comment #3 by github-bugzilla — 2013-01-19T11:03:48Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/12a54af800ca57456066825ef7a41c5151efbae9 fix Issue 9178 - UDA: getAttributes does not play well with tupleof https://github.com/D-Programming-Language/dmd/commit/9b734c5d9ff4440e6479a2b10c866e5f1d837fab Merge pull request #1505 from 9rnsr/refactor_tiargs Refactor semanticTiargs() and fix Issue 9178 - UDA: getAttributes does not play well with tupleof