Editions Ideas

Walter Bright newshound2 at digitalmars.com
Sat Dec 20 05:23:05 UTC 2025


On 12/17/2025 9:35 AM, Jonathan M Davis wrote:
> It's possible that once such struct inheritance is in the language that we'd
> then get rid of alias this in a future Edition, but no such decision has
> been made. And regardless of what happens with that in the future, I don't
> think that there's any chance that alias this would be removed in the first
> Edition. The struct inheritance stuff needs to be sorted out first.

A couple of things about 'alias this':

1. The idea is good, but the syntax is awkward.

2. It unexpectedly introduced multiple inheritance when used with classes, which 
was a huge mistake. There are many bugs in the buglist on this because we never 
defined how the multiple inheritance should be resolved, which is why D avoided 
MI in the first place. We could not find any sensible solution.

3. alias this works fine with structs, it just needs a better syntax.

4. we decided to leave alias this on classes alone, meaning whatever it does 
with classes is what it does. I highly recommend avoiding it with classes.

5. we have no idea how much existing code would break if we broke using alias 
this with classes

Let's not be too eager to dump everything we dislike into the first edition. 
Let's be a bit modest, at least for the first edition, and see if our edition 
design is a good one.



More information about the Digitalmars-d mailing list