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,
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
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.
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
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,