[Issue 12468] New: Improve foreach type mismatch error message

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 25 12:41:14 PDT 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12468

           Summary: Improve foreach type mismatch error message
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: jlquinn at optonline.net


--- Comment #0 from Jerry Quinn <jlquinn at optonline.net> 2014-03-25 12:41:11 PDT ---
svm_node*[] SV;
foreach (const ref p; SV[i]) { ... }

DMD gives:
Error: invalid foreach aggregate SV[cast(ulong)i]

I had to stare at this for a bit to figure out what was going on.  I would have
been helped if DMD had reported the type of SV[cast(ulong)i] in the message.

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


More information about the Digitalmars-d-bugs mailing list