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

           Summary: foreach over string with dchar as element isn't
                    nothrow
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: druntime
        AssignedTo: nob...@puremagic.com
        ReportedBy: jmdavisp...@gmx.com


--- Comment #0 from Jonathan M Davis <jmdavisp...@gmx.com> 2012-06-30 18:31:02 
PDT ---
This code fails to compile:

import std.stdio;

void main() nothrow
{
    foreach(dchar c; "hello world")
    {}
}

giving the error

q.d(5): Error: _aApplycd1 is not nothrow
q.d(3): Error: function D main 'main' is nothrow yet may throw

if the dchar is removed, then it compiles just fine. Clearly, there's an issue
with the apply function which implements iterating over strings as characters
other than the character type of the string, since this really should be
nothrow, but it's not.

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

Reply via email to