[Issue 13142] Enums on different classes confuse the compiler

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Jul 16 22:28:29 PDT 2014


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

--- Comment #3 from Domingo Alvarez Duarte <mingodad at gmail.com> ---
Thanks for the explanation, originally this error message appear when the
classes was on different files and the error was reporting to be on the file
with "class Button" instead of the file with "class Toolbar".

Just in case the error message problem you are trying to fix also cover this:

bugEnumButton.d(4): Error: cannot implicitly convert expression (3) of type int
to TYPE

-----bugEnumButton.d
class Button {
  enum TYPE // button type
  {
    COMMAND,
    CHECK,
    OPTION,
  }
}
-----
-----bugEnumToolbar.d
import bugEnumButton;

class Toolbar {
  enum ButtonTYPE // button type
  {
    COMMAND   = Button.TYPE.COMMAND,
    CHECK     = Button.TYPE.CHECK,
    OPTION    = Button.TYPE.OPTION,
    DELIMETER = Button.TYPE.max + 1
  }
}
-----
-----bugEnum.d
import bugEnumToolbar;

void main(){}
-----

--


More information about the Digitalmars-d-bugs mailing list