[Issue 3950] Wrong error message in recursive template call with no !

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Mar 15 07:59:28 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=3950



--- Comment #4 from bearophile_hugs at 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 / 10) ~
                               ToString!(x % 10); // missing ! here
}
pragma(msg, ToString(10));
void main() {}


Produces this error:
bug1.d(1): Error: template bug1.ToString(ulong x) is not a function template

I'd like a similar error inside the template too because I think ToString(x %
10) is a syntax error inside the the template.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list