https://issues.dlang.org/show_bug.cgi?id=19127

--- Comment #1 from | <dhase...@gmail.com> ---
Other things you can use as UDAs:

* modules: @(std.stdio)
* packages: @(std)
* references to members: struct A { int i; } @(A.i)
* uint s; @(s++). This UDA changes every time you access it.
* @(new Object). Likewise.
* string str; @(str ~= "x"). Likewise.

The only thing that doesn't work is declarations, because that's forbidden by
the grammar. It seems like there's no special semantic analysis applied other
than recursing into child expressions.

Lowering should help:

@Something int x;

into

immutable __tmp = Something;
@__tmp int x;

--

Reply via email to