Thread overview
[Issue 19081] Can't declare enum with UDA at statement level
Jul 12, 2018
Yuxuan Shui
Jul 12, 2018
Yuxuan Shui
July 12, 2018
https://issues.dlang.org/show_bug.cgi?id=19081

Yuxuan Shui <yshuiv7@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Can't declare enum with UDA |Can't declare enum with UDA
                   |in unittest blocks          |at statement level

--- Comment #1 from Yuxuan Shui <yshuiv7@gmail.com> ---
This is because, in

--
July 12, 2018
https://issues.dlang.org/show_bug.cgi?id=19081

--- Comment #2 from Yuxuan Shui <yshuiv7@gmail.com> ---
This is because, at statement level, enum is also a storage class:

    enum X = 10;

I wonder why declaring enum without a UDA works at statement level. I smell terrible hacks.

--
July 17, 2018
https://issues.dlang.org/show_bug.cgi?id=19081

--- Comment #3 from github-bugzilla@puremagic.com ---
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/89639f2876a72015ef4ade085293deb55c2f459f Fix issue 19081 - defining enum with UDA at statements level

Don't treat 'enum' as storage class if it's followed by ':', '{' or an identifier and '{'.

https://github.com/dlang/dmd/commit/4a2805d4986ee85899abeb7903f523526603291c Merge pull request #8492 from yshui/uda-enum

Fix issue 19081 - defining enum with UDA at statements level

--
July 17, 2018
https://issues.dlang.org/show_bug.cgi?id=19081

github-bugzilla@puremagic.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--