[Issue 12488] New: foreach() should accept (and ignore) 'auto' in ForeachType

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Mar 28 22:08:14 PDT 2014


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

           Summary: foreach() should accept (and ignore) 'auto' in
                    ForeachType
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: ketmar at ketmar.no-ip.org


--- Comment #0 from Ketmar Dark <ketmar at ketmar.no-ip.org> 2014-03-28 22:08:00 PDT ---
Created an attachment (id=1341)
patch against dmd commit 8e2b13b025626127e5e2a0fb90326e655f3deac8 

here is the discussion:
http://forum.dlang.org/thread/vesvrfaipppwtenleqjr@forum.dlang.org

summary: compiler should accept both foreach (v; smth) and foreach(auto v;
smth) forms. this can be noncense from compiler writer PoV, but ordinary
language user will not be confused by declaring variable without any type.

this change will not break any existing code ('auto' is purely optional).

patch attached (parser fix and two simple test cases).

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