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

           Summary: No true error message in one CTFE
           Product: D
           Version: D2
          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 2012-02-24 05:05:19 PST ---
This may be wrong D2 code, if DMD is not able to run it at compile-time:


bool not_end(const char *s, const int n) {
    return s && s[n];
}
bool str_prefix(const char *s, const char *t, const int ns, const int nt) {
    return (s == t) || !*(t + nt) || (*(s + ns) == *(t + nt) && (str_prefix(s,
t, ns+1, nt+1)));
}
bool contains(const char *s, const char *needle, const int n=0) {
    return not_end(s, n) && (str_prefix(s, needle, n, 0) || contains(s, needle,
n+1));
}
enum int x = contains("froogler", "oogle");
void main() {}



DMD 2.059head gives no true error message, just some "called from here":

bug.d(8):        called from here: str_prefix(s,needle,n,0)
bug.d(10):        called from here: contains("froogler","oogle",0)
bug.d(8):        called from here: str_prefix(s,needle,n,0)
bug.d(10):        called from here: contains("froogler","oogle",0)
bug.d(8):        called from here: str_prefix(s,needle,n,0)
bug.d(10):        called from here: contains("froogler","oogle",0)

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

Reply via email to