multiple alias this in class/struct not allowed?

Jonathan M Davis jmdavisProg at gmx.com
Mon Nov 8 16:34:18 PST 2010


On Monday, November 08, 2010 13:49:36 Adam Cigánek wrote:
> Hello,
> 
> Why are multiple alias this declarations in a class/struct not
> allowed? This page
> http://www.digitalmars.com/d/2.0/class.html#AliasThis says so, and
> also dmd2 gives me an error when I try to do it, but TDPL says
> something different (on page 231): "a class could introduce any number
> of alias this declarations, thus subtyping any number of types."). Did
> this feature change? Or is it a bug?

The online documentation isn't completely up-to-date, and dmd is not completely 
up-to-date with TDPL. In virtually all cases that TDPL and dmd conflict, TDPL 
wins, so if TDPL says something and dmd doesn't do it that way, then it's just 
that dmd is behind, and it will do it that way later. In most cases, dmd matches 
up with TDPL already, but there are several cases where it hasn't caught up yet. 
It will though. Multiple alias thises is one of those.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list