Comment #0 by john.loughran.colvin — 2016-02-10T01:01:55Z
% cat traits.d
template staticIndexOf(T)
{
enum staticIndexOf = genericIndexOf!T;
}
template genericIndexOf(args...)
{
alias e = args;
alias tuple = args;
alias tail = tuple;
enum next = genericIndexOf!(e, tail);
}
alias X = ;
static if (staticIndexOf!X)
% cat generator.d
unittest
{
import traits;
}
% dmd -unittest generator.d
traits.d(16): Error: basic type expected, not ;
traits.d(20): Error: declaration expected following attribute, not EOF
and then it just hangs forever, endlessly allocating memory.