[Issue 14269] Enum is not implicitly converted to base type when using ref

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Mar 10 10:37:12 PDT 2015


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

--- Comment #12 from Steven Schveighoffer <schveiguy at yahoo.com> ---
(In reply to Jonathan M Davis from comment #10)
> Personally, I think that all operations that the compiler can't guarantee
> will result in a valid enum value for an enum type should result in the base
> type of the enum rather than the enum type - without that, stuff like final
> switch is completely broken - but there's definitely dissent on that, and
> it's been argued about in the newsgroup.

The OP's case has nothing to do with final switch. The reality is that people
use enums for reasons other than final switch or even just individual values
(e.g. bitfields).

But I don't see how final switch can be "fixed", I can't imagine a case where
it's worth not checking for the default case in a final switch.

--


More information about the Digitalmars-d-bugs mailing list