https://issues.dlang.org/show_bug.cgi?id=12893

[email protected] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #1 from [email protected] ---
Related:

import std.algorithm;
import std.stdio;

struct S
{
    void x() inout { writeln(y.map!(a => a + 1)); }
    int[] y;
}

void main()
{
    const S s;
    s.x();
}

/usr/include/dmd/phobos/std/algorithm.d(474): Error: variable
test.S.x.MapResult!(__lambda1, inout(int)[]).MapResult._input only parameters
or stack based variables can be inout
/usr/include/dmd/phobos/std/algorithm.d(427): Error: template instance
test.S.x.MapResult!(__lambda1, inout(int)[]) error instantiating
test.d(6):        instantiated from here: map!(inout(int)[])
Failed: ["dmd", "-v", "-o-", "test.d", "-I."]

--

Reply via email to