Re: std.traits functions causing the compiler to crash

2013-06-11 Thread Regan Heath
On Sat, 08 Jun 2013 05:52:49 +0100, Eric e...@makechip.com wrote: On Saturday, 8 June 2013 at 02:32:57 UTC, bearophile wrote: Eric: Yes, the template constraint is much better. However, the compiler still crashes, even with the new code: Because there's a type definition loop,

Re: std.traits functions causing the compiler to crash

2013-06-07 Thread bearophile
Eric: Is this a known problem, or is there a work-around? This is your code reduced a little: import std.traits: hasMember; interface Xidentity(V, K) if (!hasMember!(V, x)) { } class Foo(K): Xidentity!(Foo!K, K) { K x; } void main() { new Foo!double; } I think it contains a loop at

Re: std.traits functions causing the compiler to crash

2013-06-07 Thread Eric
O import std.traits: hasMember; interface Xidentity(V, K) if (!hasMember!(V, x)) { } class Foo(K): Xidentity!(Foo!K, K) { K x; } void main() { new Foo!double; } I think it contains a loop at the level of types. In theory the compiler should catch them and give a nice error message.

Re: std.traits functions causing the compiler to crash

2013-06-07 Thread bearophile
Eric: Yes, the template constraint is much better. However, the compiler still crashes, even with the new code: Because there's a type definition loop, regardless. Using a constraint doesn't change that situation. Bye, bearophile

Re: std.traits functions causing the compiler to crash

2013-06-07 Thread Eric
On Saturday, 8 June 2013 at 02:32:57 UTC, bearophile wrote: Eric: Yes, the template constraint is much better. However, the compiler still crashes, even with the new code: Because there's a type definition loop, regardless. Using a constraint doesn't change that situation. Bye,