www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - DMD chokes on UDAs of mixin enum members

reply "BLM768" <blm768 gmail.com> writes:
I've got some code that reduces to the following test case:

------
mixin template stuff() {
	enum someEnum = "testing";
	
	static void test() {
		foreach(member; __traits(allMembers, typeof(this))) {
			pragma(msg, member);
			foreach(attribute; __traits(getAttributes, __traits(getMember, 
typeof(this), member))) {
				pragma(msg, attribute);
			}
		}
	}
}

enum Attribute;

struct Test {
	mixin stuff;

	 Attribute size_t n;
}
------

DMD handles most of the members just fine, but it is unable to 
process someEnum:

------
rdmd case.d
someEnum case.d(7): Error: first argument is not a symbol case.d(7): Error: invalid foreach aggregate false test n Attribute ------ Is there some subtle point I'm missing, or is this just a bug?
Apr 26 2013
parent reply "anonymous" <anonymous example.com> writes:
On Friday, 26 April 2013 at 21:50:51 UTC, BLM768 wrote:
[...]
 Is there some subtle point I'm missing, or is this just a bug?
Looks like http://d.puremagic.com/issues/show_bug.cgi?id=9652
Apr 26 2013
parent "BLM768" <blm768 gmail.com> writes:
That's probably it. I guess I'll have to work around it for now.

On Saturday, 27 April 2013 at 00:21:02 UTC, anonymous wrote:
 On Friday, 26 April 2013 at 21:50:51 UTC, BLM768 wrote:
 [...]
 Is there some subtle point I'm missing, or is this just a bug?
Looks like http://d.puremagic.com/issues/show_bug.cgi?id=9652
Apr 26 2013