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

           Summary: compiler errors using startsWith in CTFE
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: r.sagita...@gmx.de


--- Comment #0 from Rainer Schuetze <r.sagita...@gmx.de> 2010-06-13 01:17:32 
PDT ---
the following code fails with dmd 2.047:

import std.algorithm;

const bool var = startsWith("ab", "a");

dmd output:

c:\l\dmd2\windows\bin\..\..\src\phobos\std\functional.d(176): Error: static
assert  "Bad binary function q{a == b}. You need to use a valid D expression
using symbols a of type dchar and b of type string."
c:\l\dmd2\windows\bin\..\..\src\phobos\std\functional.d(179):       
instantiated from here: Body!(dchar,string)
c:\l\dmd2\windows\bin\..\..\src\phobos\std\algorithm.d(1983):       
instantiated from here: result!(dchar,string)

the error disappears if you remove the "const".

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

Reply via email to