[Issue 3512] New: dchar iteration over string in CTFE fails

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Nov 15 03:17:23 PST 2009


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

           Summary: dchar iteration over string in CTFE fails
           Product: D
           Version: 2.036
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: wbaxter at gmail.com


--- Comment #0 from Bill Baxter <wbaxter at gmail.com> 2009-11-15 03:17:22 PST ---
Code:
    string s = "ohai";
    foreach (int i, dchar c; s)
    {}


Error:
Error: cannot evaluate _aApplycd2(s,int delegate(ref int __applyArg0, ref dchar
__applyArg1)
{
dchar c2 = __applyArg1;
int i = __applyArg0;
if (cast(uint)c == cast(uint)c2)
__result = i;
return 2;
return 0;
}
) at compile time


foreach(dchar c; s)  also fails similarly.

-- 
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