http://d.puremagic.com/issues/show_bug.cgi?id=3950
--- Comment #2 from bearophile_h...@eml.cc 2010-03-15 07:37:30 PDT ---
The ToString name with no bang inside the template refers to itself. Then for
the compiler what's the meaning of ToString(x % 10) inside this template?
The error message
http://d.puremagic.com/issues/show_bug.cgi?id=3950
--- Comment #3 from Steven Schveighoffer schvei...@yahoo.com 2010-03-15
07:44:20 PDT ---
The error is a recursive expansion. I think it's fairly obvious. The compiler
cannot expand the template because the template depends on the result of
http://d.puremagic.com/issues/show_bug.cgi?id=3950
--- Comment #4 from bearophile_h...@eml.cc 2010-03-15 07:59:27 PDT ---
This code:
template ToString(ulong x) {
static if (x 10)
enum string ToString = ~ cast(char)(x + '0');
else
enum string ToString = ToString!(x /
http://d.puremagic.com/issues/show_bug.cgi?id=3950
--- Comment #5 from Steven Schveighoffer schvei...@yahoo.com 2010-03-15
08:16:28 PDT ---
The compiler can't figure out whether ToString is a function or not, because it
can't evaluate it. It's like asking for this:
void 12345()
{
}
to