Testing implicit conversion to template instance with is() expression

2015-03-15 Thread via Digitalmars-d-learn
Should this work? struct V(string s) { } struct S(int U) { V!xyz x; alias x this; } void main() { S!10 a; static assert(is(a : V!Args, Args...)); } With DMD Git master, the static assert() fails. Should it? Am I doing something wrong?

Re: Testing implicit conversion to template instance with is() expression

2015-03-15 Thread Ali Çehreli via Digitalmars-d-learn
On 03/15/2015 08:47 AM, Marc =?UTF-8?B?U2Now7x0eiI=?= schue...@gmx.net wrote: Should this work? struct V(string s) { } struct S(int U) { V!xyz x; alias x this; } void main() { S!10 a; static assert(is(a : V!Args,

Re: Testing implicit conversion to template instance with is() expression

2015-03-15 Thread via Digitalmars-d-learn
On Sunday, 15 March 2015 at 16:44:14 UTC, Ali Çehreli wrote: On 03/15/2015 08:47 AM, Marc =?UTF-8?B?U2Now7x0eiI=?= schue...@gmx.net wrote: Should this work? struct V(string s) { } struct S(int U) { V!xyz x; alias x this; } void main() {

Re: Testing implicit conversion to template instance with is() expression

2015-03-15 Thread via Digitalmars-d-learn
https://issues.dlang.org/show_bug.cgi?id=14286 In the meantime, does someone know of a suitable workaround?

Re: Testing implicit conversion to template instance with is() expression

2015-03-15 Thread via Digitalmars-d-learn
On Sunday, 15 March 2015 at 16:53:34 UTC, Marc Schütz wrote: On Sunday, 15 March 2015 at 16:44:14 UTC, Ali Çehreli wrote: On 03/15/2015 08:47 AM, Marc =?UTF-8?B?U2Now7x0eiI=?= schue...@gmx.net wrote: Should this work? struct V(string s) { } struct S(int U) { V!xyz

Re: Testing implicit conversion to template instance with is() expression

2015-03-15 Thread via Digitalmars-d-learn
On Sunday, 15 March 2015 at 18:53:33 UTC, Nicolas Sicard wrote: Can be reduced to: struct Foo(int i) {} alias Foo1 = Foo!1; static assert(is(Foo!2 == Foo1!T, T...)); // OK I think it's another bug. Right, I've filed another report: https://issues.dlang.org/show_bug.cgi?id=14290

Re: Testing implicit conversion to template instance with is() expression

2015-03-15 Thread via Digitalmars-d-learn
On Sunday, 15 March 2015 at 17:03:42 UTC, Marc Schütz wrote: https://issues.dlang.org/show_bug.cgi?id=14286 In the meantime, does someone know of a suitable workaround? I found the following workaround. Not beautiful, but it works: enum isValue(alias T) = __traits(compiles, typeof(T));

Re: Testing implicit conversion to template instance with is() expression

2015-03-15 Thread Nicolas Sicard via Digitalmars-d-learn
On Sunday, 15 March 2015 at 18:33:32 UTC, Marc Schütz wrote: On Sunday, 15 March 2015 at 17:03:42 UTC, Marc Schütz wrote: https://issues.dlang.org/show_bug.cgi?id=14286 In the meantime, does someone know of a suitable workaround? I found the following workaround. Not beautiful, but it works: