UDA: getAttributes does not play well with topleof

Walter Bright newshound2 at digitalmars.com
Mon Dec 17 08:26:13 PST 2012


On 12/17/2012 3:55 AM, d coder wrote:
> So my question is: Is this a bug in DMD, or am I doing something plainly wrong?

You're doing something wrong. Consider:

@Bar int i = 3;
int x = i;

The UDA does not get transferred to x. This is why your loop:

foreach(ref l; foo.tupleof)

does not transfer the UDAs to l.



More information about the Digitalmars-d mailing list