Thread overview
[Issue 2859] enum convert error
Sep 17, 2019
RazvanN
Dec 17, 2022
Iain Buclaw
Aug 08, 2023
Nick Treleaven
Aug 08, 2023
Nick Treleaven
August 24, 2015
https://issues.dlang.org/show_bug.cgi?id=2859

hsteoh@quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hsteoh@quickfur.ath.cx

--- Comment #2 from hsteoh@quickfur.ath.cx ---
Still happens on git HEAD. Verified on git HEAD (5b468ace36ac8eaa6de215b1e376aece9ccc1084), Linux/64-bit.

--
September 17, 2019
https://issues.dlang.org/show_bug.cgi?id=2859

RazvanN <razvan.nitu1305@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |razvan.nitu1305@gmail.com

--- Comment #3 from RazvanN <razvan.nitu1305@gmail.com> ---
Shouldn't this be an error that kkk does not devine member vv? I can't find anything about this in the spec.

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=2859

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P3

--
August 08, 2023
https://issues.dlang.org/show_bug.cgi?id=2859

Nick Treleaven <nick@geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nick@geany.org

--- Comment #4 from Nick Treleaven <nick@geany.org> ---
> Shouldn't this be an error that kkk does not devine member vv?

It still errors if you replace the last line with:

  t = abc.vv;

(I think because kkk.vv doesn't exist, the compiler looks in the base type to
see if it defines vv.)

--
August 08, 2023
https://issues.dlang.org/show_bug.cgi?id=2859

--- Comment #5 from Nick Treleaven <nick@geany.org> ---
I think the error is correct according to the spec:

> EnumBaseType types cannot be implicitly cast to an enum type.

https://dlang.org/spec/enum.html#named_enums

abc.vv (or kkk.vv which resolves to that) is of type abc, so it can't be cast to type kkk, which t is.

--