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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Apr 4 02:02:14 UTC 2021


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Dlang Bot <dlang-bot at dlang.rocks> ---
dlang/dmd pull request #12325 "Fix 21785 - Improve error messages for opaque
enums" was merged into master:

- 92d1d59eb61f776e98b28deb75b6f64374b0e03b by MoonlightSentinel:
  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