[Issue 19708] Can't use __traits(getAttributes, ...)[...] as a type

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jul 6 10:42:43 UTC 2019


--- Comment #3 from Basile-z <b2.temp at gmx.com> ---
Most of the fix is easy but the part involving an index is more complicated
because there's a kind of precedence problem:

  alias d = __traits(getAttributes, bar)[0];

is more like (using parens to explain even if not valid)

  alias d = IndexedBy(__traits(getAttributes, bar), 0);

The internal wrapper is itself wrapped in the type that stores the index so a
flag indicating if symbols are allowed when processing the trait is never set.
That's why there's the spurious error message about giving a type.


More information about the Digitalmars-d-bugs mailing list