Can now use alias for collapsing multiple fields in nested structs

Walter Bright newshound2 at digitalmars.com
Thu Jan 2 19:03:46 UTC 2025


On 1/2/2025 3:32 AM, Vladimir Panteleev wrote:
> Thank you, I'm curious what does this enable on top of
> 
> ```d
>      @property ref ti() => t.i;
> ```
> ?

Great question! Some answers:

1. the alias means `i` can be any symbol, not just a field

2. the alias thing has been brought up before (see Steven) yet nobody has 
thought of your solution

3. people simply expect the alias to work

4. use of @property has been discouraged for a long time

5. the alias is simpler and easier on the eyes



More information about the Digitalmars-d mailing list