On Thursday, 27 April 2023 at 00:16:10 UTC, Walter Bright wrote:
This also works:
alias F = MySuperLongNameFlag;
auto flag = F.A | F.B | F.C | F.D;
set_flags(F.A | F.B | F.C | F.D);
It's similar to setting a local variable to some complex
expression, just so you don't have to repeat that expression
multiple times.
It's a misconception of the problem that the DIP tried to solve.
What the DIP tried to solve is that the compiler should know that
you are using an enum member. Actually I even think this should
work without any special syntax, as a "last resort", let's say.
But as you've explained, through Mike's report, this causes
problems for D because the identifier resolution is tied to a
particular implementation, i.e your fast symtabs.