So, User-Defined Attributes

Philippe Sigaud philippe.sigaud at gmail.com
Sat Jan 5 10:54:08 PST 2013


On Sat, Jan 5, 2013 at 6:00 PM, Jacob Carlborg <doob at me.com> wrote:

> Just for the record, the extra parentheses are not needed:
>
> @doc("This function does.... ") auto foo () {  }
> @Sorted!(withThisFun) someRange ...


Good to know. I tested it with basic values and this fails:

@"hello" int i;
@3 inj j;

Worth a bug report?

As a complement, multiple @'s are possible:

@("hello") @(3) int j;


And another complement:

struct S {}

@S S s; is possible.

But

@int S s;

is not

So user-defined types are OK, but not basic types. Looks like a
parsing/grammar problem for me, since attribute tuple sure should be able
to store built-in types.
Another bug report?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130105/01852a81/attachment-0001.html>


More information about the Digitalmars-d mailing list