Thread overview | ||||||
---|---|---|---|---|---|---|
|
July 14, 2013 UDA's for enum values? | ||||
---|---|---|---|---|
| ||||
I would like to do something like enum e { @(string) p, @(int) i } class a { mixin(generatePropertiesFromEnum!e); } which would produce the result interface a { @property string p(); @property int i(); } I can generate the properties without issue but I can't seem to attach properties to elements in the enum. I guess this is a "inverse-feature" feature of D? |
July 14, 2013 Re: UDA's for enum values? | ||||
---|---|---|---|---|
| ||||
Posted in reply to JS | that should be interface a instead of class a. |
July 14, 2013 Re: UDA's for enum values? | ||||
---|---|---|---|---|
| ||||
Posted in reply to JS | On Sunday, 14 July 2013 at 12:33:07 UTC, JS wrote:
> I would like to do something like
> ...
Looks like a grammar issue. UDA's are supposed to be attached to any symbol declaration as far as I understand, which enum members definitely are. Probably worth bugzilla entry.
|
July 14, 2013 Re: UDA's for enum values? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dicebot | On Sunday, 14 July 2013 at 13:38:41 UTC, Dicebot wrote: > On Sunday, 14 July 2013 at 12:33:07 UTC, JS wrote: >> I would like to do something like >> ... > > Looks like a grammar issue. UDA's are supposed to be attached to any symbol declaration as far as I understand, which enum members definitely are. Probably worth bugzilla entry. Looks like http://d.puremagic.com/issues/show_bug.cgi?id=9701 |
Copyright © 1999-2021 by the D Language Foundation