std.algorithm.countUntil and alias

Anton Pastukhov caffeine9999 at mailbox.org
Wed Oct 23 17:18:47 UTC 2024


On Wednesday, 23 October 2024 at 14:50:44 UTC, Paul Backus wrote:

> On Wednesday, 23 October 2024 at 12:46:24 UTC, Paul Backus 
> wrote:

> You can't use an `alias` to refer to a member variable like 
> this. When you write
>
>     alias myAlias = myStruct.test;
>
> ...it is silently rewritten by the compiler to
>
>     alias myAlias = MyStruct.test;
>
> So, in reality, there is no difference between the two versions.

Is it intended behavior? Is it documented somewhere? I'm looking 
here https://dlang.org/spec/declaration.html#alias and it states: 
"An AliasDeclaration creates a symbol name that refers to a type 
or another symbol". `myStruct.test` is a symbol.


More information about the Digitalmars-d-learn mailing list