[Issue 21785] Cannot declare variable of opaque enum with base type

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Apr 2 20:29:20 UTC 2021


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

Dlang Bot <dlang-bot at dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #2 from Dlang Bot <dlang-bot at dlang.rocks> ---
@MoonlightSentinel updated dlang/dmd pull request #12325 "Fix 21785 - Improve
error messages for opaque enums" fixing this issue:

- Fix 21785 - Improve error messages for opaque enums

  The error messages for default initialized variables of opaque enums
  were horrid and contained misleading informations.
  This PR removes them by by checking whether semantic was already
  run in case of an enum without members.

  Some examples:

  ```d
  enum NoBase;
  enum WithBase : long;

  // Not handled yet
  struct S;
  enum OpaqueBase : S;

  void main()
  {
      NoBase nb;
      WithBase wb;
      OpaqueBase ob;
  }
  ```

https://github.com/dlang/dmd/pull/12325

--


More information about the Digitalmars-d-bugs mailing list