blob: 3b9bcd70f1bae1583244ffe196abd3437f79d383 [file] [log] [blame]
// https://issues.dlang.org/show_bug.cgi?id=2920
// recursive templates blow compiler stack
// template_29_B.
/*
TEST_OUTPUT:
---
fail_compilation/fail281.d(15): Error: template instance `fail281.foo!4294966795u` recursive expansion exceeded allowed nesting limit
---
*/
template foo(uint i)
{
static if (i > 0)
{
const uint bar = foo!(i - 1).bar;
}
else
{
const uint bar = 1;
}
}
int main()
{
return foo!(uint.max).bar;
}