Multiple subtyping with alias this and nested classes

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sat Oct 3 13:16:54 PDT 2009


language_fan wrote:
> On Sat, 03 Oct 2009 13:52:51 -0300, Leandro Lucarella wrote:
> 
>>> Scala supports that with mixins, D supports that with multiple
>>> subtyping.
>> I don't know what you mean about multiple subtyping.
> 
> I have also not seen the specs for this feature. How does multiple 
> subtyping work exactly in D?

The feature is very much in the works. I gave a basic example for two
types. Unfortunately at the moment only one alias this declaration is
allowed. The plan is to allow any number.

> Does it have exactly the same semantics as 
> using interfaces + mixing in the traits?

No.

> Why was the 'alias foo this' 
> chosen if you are also planning to add support for Scala like traits 
> (some other thread here recently discussed this).

Currently there are no plans to add support for Scala-like traits.

> Andrei, you probably 
> know how Scala chooses the overrides and overloads when traits have 
> conflicts. How does D handle this?

Walter and I are working the kinks of name lookup. If you have ideas,
please share.


Andrei



More information about the Digitalmars-d mailing list