[Issue 22565] Attributes not accepted for empty declaration

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Dec 7 12:47:06 UTC 2021


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

--- Comment #3 from RazvanN <razvan.nitu1305 at gmail.com> ---
Ok, I was hasty in my judgement, however, I think that empty declarations are
there just to have symmetry with empty statements (as you cannot have
statements at top level), still I don't see any point in allowing attaching a
UDA to an empty declaration.

To be more precise, UDA's are attached to symbols (that are indeed introduced
by declarations). As far as I could tell you cannot attach a UDA to an
anonymous function or an anonymous class, specifically because it does not have
a name.

I guess we can modify the spec to specifically mention that UDAs must be
applied to a symbol.

--


More information about the Digitalmars-d-bugs mailing list