Code: ------- unittest { import std.algorithm.comparison : equal; import std.algorithm.iteration : chunkBy; string[] data = [ "abc", "abc", "def" ]; int[] indices = [ 0, 1, 2 ]; auto chunks = indices.chunkBy!((i, j) => data[i] == data[j]); assert(chunks.equal!equal([ [ 0, 1 ], [ 2 ] ])); } ------- Compiler output: ------- /usr/src/d/phobos/std/algorithm/iteration.d(1761): Error: function test.__unittest_L9_C1.ChunkByImpl!(__lambda1, int[]).ChunkByImpl.Group.popFront cannot access frame of function test.__unittest_L9_C1 /usr/src/d/phobos/std/range/primitives.d(884): Error: template instance `std.range.primitives.isInputRange!(Group)` error instantiating /usr/src/d/phobos/std/algorithm/iteration.d(1781): instantiated from here: isForwardRange!(Group) -------
https://github.com/dlang/phobos/pull/6441
This is related to issue #14909, but the PR only fixes this problem, not that one, so I'm keeping the bug reports separate for now.
PR has been closed, as it has been decided this needs to be addressed in the compiler rather than the library.
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19422 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB