Actually y!() is the problem, the other bit is just instantiating y.
Also stack overflows on D1 and 2.057.
The reason is, that the FQN of the delegate includes the FQN of the template. You can see this if you use .mangleof (uncomment the pragma).
Simplified test case:
void y (alias f) () {
int delegate(int) qq;
// pragma(msg, qq.mangleof);
y!(qq)();
}
void x1() { int q; y!(q)(); }
Comment #2 by bugzilla — 2013-10-03T18:03:52Z
With 2.064 head:
Michal's example:
test.d(1): Error: template instance test.x1.y!((a) => a) recursive expansion
Don's example:
test.d(7): Error: template instance test.x1.y!(q) recursive expansion
Works on D1 1.077 too.