[Issue 7799] Can't use alias for overload resolution with alias this subtype

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Sep 19 00:05:44 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=7799



--- Comment #2 from Kenji Hara <k.hara.pg at gmail.com> 2013-09-19 00:05:39 PDT ---
(In reply to comment #1)
> Works in 2.063.2.

Note that, even `alias super.test test` is compiled, but still cannot call it
from FooBar object.

// class definitions are same as comment#0

void main()
{
    auto c = new FooBar();

    assert(c.test());
    // Error: this for test needs to be type Foo not type test.FooBar

    assert(c.test(1));
    // OK
}

Currently D does not support expression alias, so `alias super.test test` would
lost the implicit expression context 'foo' by alias this.

Then, c.test() will be rewritten to `(c, Foo.test())`, and fails to compile.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list