On 6/2/20 1:56 AM, realhet wrote:
> struct A{
> struct B{ int c; }
> B b;
>
> auto f(){
> alias d = b.c;
The spec explicitly says it's not legal: "Aliases cannot be used for
expressions" (Item 10):
https://dlang.org/spec/declaration.html#alias
I use nested functions for such cases:
auto f(){
auto d() {
return b.c;
}
return d;
}
Ali