DIP66 v1.1 (Multiple) alias this.

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Wed Dec 24 14:09:48 PST 2014


On 12/24/14 12:58 AM, Daniel Nielsen wrote:
> On Wednesday, 24 December 2014 at 06:17:28 UTC, Andrei Alexandrescu wrote:
>> In fact a better thought: as soon as D is defined, repeated subtyping
>> should be detected as an error. Then there's no question about "is" in
>> the first place :o).
>>
>>
>> Andrei
>
> Agreed. How about using "override alias this" when disambiguating, in
> order to make it more explicit?
>
> struct C
> {
>    alias a this;
>    alias b this;
>    override alias b.i this; // override inherited alias int this.
>    A a;
>    B b;
> }

Is there a need for explicit overriding, i.e. any inadvertent error 
people may make without it? -- Andrei


More information about the Digitalmars-d mailing list