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

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Mar 12 05:00:58 PDT 2015


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

--- Comment #21 from Steven Schveighoffer <schveiguy at yahoo.com> ---
(In reply to Ali Cehreli from comment #18)
> I think this boils down to whether an enum's conversion to its base type is
> an implicit cast (an rvalue), versus the enum itself (an lvalue). (Steven
> says it's the latter.)

Since this change has broken code, the question to answer is, does this break
code that should be broken? Final switch does not show a case of invalid code
that is now fixed by this change, and I haven't seen any other challenges of
breakage. So if it doesn't break anything worth breaking, why are we doing it?

To me, this doesn't break any code that is invalid. Regardless of whether it's
philosophically correct or not, avoiding breaking only valid code should take
precedence. That is why I said I understand the reason and somewhat agree with
the reason, but I still think it should be reverted.

--


More information about the Digitalmars-d-bugs mailing list