debug a reserved keyword (even for enums?)
Dejan Lekic
dejan.lekic at gmail.com
Sun Apr 12 08:36:40 UTC 2026
On Friday, 10 April 2026 at 22:37:54 UTC, Katastic wrote:
> Hello all, it's been awhile. I have a question. Does it make
> 'sense' that debug is a reserved keyword even when its inside
> an enum?
>
> ```D
> enum loggingLevel {
> none = 0,
> debug, // Error: found `debug` when expecting `identifier`
> info,
> warning,
> error
> }
> ```
This is one of the main reasons why I use UPPER_SNAKE_CASE style
for enum fields in all my code. Some other teams use PascalCase
(upper camel-case). It is not just `debug`. `default` and
`version` are other examples.
More information about the Digitalmars-d
mailing list