[Issue 24341] Switch over enum are poorly verified

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jul 25 20:47:21 UTC 2024


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

Bolpat <qs.il.paperinik at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |qs.il.paperinik at gmail.com

--- Comment #1 from Bolpat <qs.il.paperinik at gmail.com> ---
This is actually 2 issues:
- If a `case` label is out of range for the `enum` type’s backing type, should
that be illegal? (IMO, yes, except in templates.)

- If a `case` label has a value that’s in range for the type’s backing type,
but is different from all `enum` values, should that be an error? (IMO, hard
no. Some `enum` types are bit-fields and it can make sense to test for certain
combinations specifically.)

--


More information about the Digitalmars-d-bugs mailing list