Improvement to struct inheritance possible?

Danilo codedan at aol.com
Fri Jan 19 06:10:18 UTC 2024


Thanks for all the replies!

Of course the part "struct inheritance" was nonsense.
The problem has nothing to do with, it's just about
`alias this = xyz` inside classes and structs.



On Thursday, 18 January 2024 at 20:43:30 UTC, Meta wrote:
> All it does is when you try to access a symbol through a 
> Derived struct (e.g. `Derived d; writeln(d.a);`) that the 
> compiler sees does not exist in Derived, it will rewrite that 
> to `Derived d; writeln(d.base.a);`

Perfect! Only thing is missing, that this works everywhere
inside classes and structs - including method/constructor 
parameters.

If `a` isn't found, replace it with `base.a`.



More information about the Digitalmars-d mailing list