www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9859] New: Cannot use inout in delegate

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9859

           Summary: Cannot use inout in delegate
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: doob me.com



The following code fails to compile:

void foo (inout int[] arr)
{
    auto dg = {
        foreach (i, e ; arr) {}
    };
    dg();
}

void main ()
{
    auto a = [3, 4, 5];
    foo(a);
}

Error message:

main.d(9): Error: variable main.foo.__lambda1.__aggr1174 inout variables can
only be declared inside inout functions
main.d(9): Error: variable main.foo.__lambda1.e 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: -------
Apr 02 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9859


Henning Pohl <henning still-hidden.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull, rejects-valid
                 CC|                            |henning still-hidden.de



PDT ---
https://github.com/D-Programming-Language/dmd/pull/2399

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 28 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9859




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/95830234837da368f19be6ac4ed0ae2538ea2ecd
fix issue 9859 - Cannot use inout in delegate

https://github.com/D-Programming-Language/dmd/commit/874036c5847a8cd7ea84d3d74d5281a75fea90e2


fix issue 9859 - Cannot use inout in delegate

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 29 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9859


Walter Bright <bugzilla digitalmars.com> changed:

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


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