<br><br><div class="gmail_quote">On Mon, Dec 17, 2012 at 9:56 PM, Walter Bright <span dir="ltr"><<a href="mailto:newshound2@digitalmars.com" target="_blank">newshound2@digitalmars.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im">On 12/17/2012 3:55 AM, d coder wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
So my question is: Is this a bug in DMD, or am I doing something plainly wrong?<br>
</blockquote>
<br></div>
You're doing something wrong. Consider:<br>
<br>
@Bar int i = 3;<br>
int x = i;<br>
<br>
The UDA does not get transferred to x. This is why your loop:<br>
<br>
foreach(ref l; foo.tupleof)<br>
<br>
does not transfer the UDAs to l.<br>
<br>
</blockquote></div><br><div>But Walter, even the code below does not work.</div><div>Error: first argument is not a symbol</div><div><div>tuple(false)</div></div><div><br></div><div><br></div><div><div>template Tuple(T...) {</div>

<div>  alias T Tuple;</div><div>}</div><div><br></div><div>enum Bar;</div><div>class Foo {</div><div>  @Bar int a;</div><div>}</div><div><br></div><div>void main()</div><div>{</div><div>  Foo foo = new Foo;</div><div>  alias Tuple!(__traits(getAttributes, foo.tupleof[0])) tp;</div>

<div>  pragma(msg, tp);</div><div>}</div></div><div><br></div>