D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 9178 - UDA: getAttributes does not play well with tupleof
Summary: UDA: getAttributes does not play well with tupleof
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 blocker
Assignee: No Owner
URL:
Keywords: pull, rejects-valid
Depends on:
Blocks:
 
Reported: 2012-12-18 09:18 UTC by Puneet Goel
Modified: 2013-01-19 11:05 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Puneet Goel 2012-12-18 09:18:57 UTC
http://forum.dlang.org/thread/mailman.2763.1355745364.5162.digitalmars-d@puremagic.com

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 2 Jacob Carlborg 2013-01-17 23:37:05 UTC
Awesome.
Comment 3 github-bugzilla 2013-01-19 11:03:48 UTC
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