Thread overview
[Issue 6867] New: inout and nested foreach loops
Oct 30, 2011
Kenji Hara
Oct 31, 2011
Walter Bright
October 30, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6867

           Summary: inout and nested foreach loops
           Product: D
           Version: D2
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: siegelords_abode@yahoo.com


--- Comment #0 from siegelords_abode@yahoo.com 2011-10-30 11:21:41 PDT ---
DMD version: 2.056

inout(char)[] test(inout(char)[] a)
{
    foreach(dchar d; a) // No error if 'dchar' is removed
    {
        foreach(c; a) // line 5
        {

        }
    }
    return [];
}

test.d(5): Error: variable test.test.__foreachbody3.__aggr4 inout variables can
only be declared inside inout functions
test.d(5): Error: variable test.test.__foreachbody3.c inout variables can only
be declared inside inout functions

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 30, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6867


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch, rejects-valid


--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2011-10-30 12:32:43 PDT ---
https://github.com/D-Programming-Language/dmd/pull/481

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 31, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6867


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |FIXED


--- Comment #2 from Walter Bright <bugzilla@digitalmars.com> 2011-10-31 12:12:00 PDT ---
https://github.com/D-Programming-Language/dmd/commit/3448ffd1b407453aba647da5f0435f648cfbe04f

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