AliasSeq in UDA
Basile B.
b2.temp at gmx.com
Sun Mar 10 13:41:32 UTC 2019
On Sunday, 10 March 2019 at 13:20:12 UTC, Sebastiaan Koppe wrote:
> The compiler complains about `cannot form tuple of tuples`
> whenever I try to put an AliasSeq in a UDA and try to use it.
>
> You would expect the compiler to expand it. Is this a bug?
>
> ---
>
> import std.meta;
>
> enum A; enum B;
>
> @AliasSeq!(A,B) // <-- Error: cannot form tuple of tuples
> struct Foo {}
>
> pragma(msg, __traits(getAttributes, Foo)); // <- must be
> present (error happens only when queried)
>
> void main() {}
>
> ---
>
> link to run.dlang.io:
> https://run.dlang.io/gist/cd5cd94d8ce5327e8a7d5ad77f1d15b8
It looks like a bug, a "reject-valid" one.
Try the same code with
enum A = 0;
and it work, despite of B being still opaque. The problem may be
related to the fact the enum A in the orginal code is opaque and
has not type.
I've seen a related issue lately.
More information about the Digitalmars-d-learn
mailing list