www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12468] New: Improve foreach type mismatch error message


           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 puremagic.com
        ReportedBy: jlquinn optonline.net

--- Comment #0 from Jerry Quinn <jlquinn 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: -------
Mar 25 2014