enum E { @(1) v1 } void main() {} $ dmd t t.d(2): Error: basic type expected, not @ t.d(2): Error: type only allowed if anonymous enum and no enum type t.d(2): Error: if type, there must be an initializer t.d(2): Error: found '@' when expecting ',' t.d(2): Error: basic type expected, not ( t.d(2): Error: unexpected ( in declarator t.d(2): Error: basic type expected, not 1 t.d(2): Error: found '1' when expecting ')' t.d(2): Error: type only allowed if anonymous enum and no enum type t.d(2): Error: if type, there must be an initializer t.d(2): Error: found ')' when expecting ','
What the heck?? 4 years and this hasn't been fixed?!?!?!
(In reply to TeddyBear12311 from comment #1) > What the heck?? 4 years and this hasn't been fixed?!?!?! There was a pull request done a while back, but seems this needs a DIP? https://github.com/dlang/dmd/pull/6161
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/36d349c6fffc734ee13b05e6927d1a4a01444a24 Fix Issue 9701 - allow UDAs to be attached to enum values https://github.com/dlang/dmd/commit/972ea45d847518cc2559c596ee198266a6bd3d27 Merge pull request #8404 from IgorStepanov/uda-enum Fix Issue 9701 - allow UDAs to be attached to enum values merged-on-behalf-of: Jacob Carlborg <jacob-carlborg@users.noreply.github.com>
dlang/dmd pull request #12108 "[dmd-cxx] Support deprecated, @disable and user-defined attributes on enum members" was merged into dmd-cxx: - b39ef4eda243848cc532bc5352956c129bc3d320 by JinShil: [dmd-cxx] Fix Issue 9701 - allow UDAs to be attached to enum values https://github.com/dlang/dmd/pull/12108