[Issue 19615] alias this not taken when member is

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jan 28 13:15:06 UTC 2019


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

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

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

--- Comment #1 from RazvanN <razvan.nitu1305 at gmail.com> ---
I don't think this issue is valid. Alias this should be viewed as inheritance,
so your example should behave exactly as:

class Test1
{
    int member() { return 0; }
}

class Test2 : Test1
{
    int member(int n) { return n; }
}

void main()
{
    Test2 a;
    a.member();           // error : function test.Test2.member(int n) is not
callable using argument types ()
}

Currently, in dmd if you want to include an overload in the baseclass overload
set you have to use alias (alias member = typeof(super).member), then the
example compiles. I suggest you use this technique in your code.

I suggest we close this as invalid.

--


More information about the Digitalmars-d-bugs mailing list