[Issue 21455] New: Cannot call an overload aliased from a base struct

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Dec 4 16:12:29 UTC 2020


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

          Issue ID: 21455
           Summary: Cannot call an overload aliased from a base struct
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: maxsamukha at gmail.com

struct Base {
    void foo(int) {
    }
}

struct Derived {
    Base base;
    alias base this;

    alias foo = Base.foo;

    void foo() {
        foo(1);
    }
}

onlineapp.d(13): Error: this for foo needs to be type Base not type Derived


Obviously, this should compile because Derived implicitly converts to Base.

--


More information about the Digitalmars-d-bugs mailing list