[Issue 23865] duplicate alias not detected

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon May 1 12:11:49 UTC 2023


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |razvan.nitu1305 at gmail.com
           Severity|minor                       |critical

--- Comment #1 from RazvanN <razvan.nitu1305 at gmail.com> ---
Using `back` when `element` is aliased leads to an ice:

  class AssignableRange
  {
      int element;
      int front()
      {
          return element;
      }
      alias back = front;

      void front(int newValue)
      {
          element = newValue;
      }
      alias back = element;
  }

  void main()
  {
      AssignableRange a = new AssignableRange();

      a.back;                                                                   
  }

core.exception.AssertError at src/dmd/access.d(341): Non overloadable Aliasee in
overload list

--


More information about the Digitalmars-d-bugs mailing list