[Issue 19132] New: Attempting to override an alias crashes DMD

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Aug 1 17:41:17 UTC 2018


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 at puremagic.com
          Reporter: contact at 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.

--


More information about the Digitalmars-d-bugs mailing list