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

           Summary: Wrong error message in recursive template call with no
                    !
           Product: D
           Version: 2.041
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2010-03-13 04:51:48 PST ---
This is wrong D2 code (there is a ToString(x % 10) with no bang):


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() {}


The compiler gives a wrong error message:
test.d(8): Error: template instance bug3.ToString!(10) recursive expansion

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

Reply via email to