www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19132] New: Attempting to override an alias crashes DMD

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

          Issue ID: 19132
           Summary: Attempting to override an alias crashes DMD
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Severity: trivial
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: contact christianwilson.me

Attempting to compile the following code results in an Access Violation with
DMD 2.081.1:

    class Base
    {
        void test()
        {
        }

        alias hello = test;
    }

    class Derived : Base
    {
        override void hello()
        {
        }
    }

Expected result:

    Error: function `app.Derived.hello` does not override any function.

Special casing attempts to override an alias alternatively could produce an
error along the lines of "function `app.Derived.hello` cannot override an
alias."

As a note, moving `alias hello = test` to Derived produces the expected result.

--
Aug 01 2018