digitalmars.D.learn - AliasSeq in UDA
- Sebastiaan Koppe (14/14) Mar 10 2019 The compiler complains about `cannot form tuple of tuples`
- Basile B. (8/22) Mar 10 2019 It looks like a bug, a "reject-valid" one.
- Basile B. (2/34) Mar 10 2019 It was 19605. But the relationship is not so obvious...
- Sebastiaan Koppe (15/21) Mar 10 2019 Thanks. The example I posted was a reduced case, but I can still
- Basile B. (3/26) Mar 10 2019 Yes I see. I've refined a bit the test case and maybe I'll took a
- Sebastiaan Koppe (4/6) Mar 10 2019 Cool. Is it normal to create a testcase that doesn't depend on
- Basile B. (2/8) Mar 10 2019 Yes.
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
Mar 10 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/cd5cd94d8ce5327e8a7d5ad77f1d15b8It 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.
Mar 10 2019
On Sunday, 10 March 2019 at 13:41:32 UTC, Basile B. wrote:On Sunday, 10 March 2019 at 13:20:12 UTC, Sebastiaan Koppe wrote:It was 19605. But the relationship is not so obvious...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/cd5cd94d8ce5327e8a7d5ad77f1d15b8It 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.
Mar 10 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
Mar 10 2019
On Sunday, 10 March 2019 at 16:05:19 UTC, Sebastiaan Koppe wrote:On Sunday, 10 March 2019 at 13:41:32 UTC, Basile B. wrote:Yes I see. I've refined a bit the test case and maybe I'll took a look this week.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
Mar 10 2019
On Sunday, 10 March 2019 at 16:46:43 UTC, Basile B. wrote:Yes I see. I've refined a bit the test case and maybe I'll took a look this week.Cool. Is it normal to create a testcase that doesn't depend on phobos? I suppose it is needed for it to be included in dmd's testcases.
Mar 10 2019
On Sunday, 10 March 2019 at 17:04:20 UTC, Sebastiaan Koppe wrote:On Sunday, 10 March 2019 at 16:46:43 UTC, Basile B. wrote:Yes.Yes I see. I've refined a bit the test case and maybe I'll took a look this week.Cool. Is it normal to create a testcase that doesn't depend on phobos? I suppose it is needed for it to be included in dmd's testcases.
Mar 10 2019