AliasSeq in UDA

Sebastiaan Koppe mail at skoppe.eu
Sun Mar 10 16:05:19 UTC 2019


On Sunday, 10 March 2019 at 13:41:32 UTC, Basile B. wrote:
> 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.

Thanks. The example I posted was a reduced case, but I can still 
use your trick to fool the compiler.

The following is more real:

---

import std.meta;

enum A; enum B; enum Dummy = 0; // <- Dummy needs to be 0

struct Param(alias T) {}

@AliasSeq!(Dummy,Param!A,Param!B) // <- Here Dummy is needed
struct Foo {}

pragma(msg, __traits(getAttributes, Foo));

void main() {}

---

I have created an issue: 
https://issues.dlang.org/show_bug.cgi?id=19728


More information about the Digitalmars-d-learn mailing list