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

--- Comment #1 from [email protected] ---
This appears to be a bug in std.algorithm.map: here's a minimal test case
reduced from the implementation of cartesianProduct:

------
import std.stdio: writeln;
import std.algorithm;

auto f(R1)(R1 range1)
{
    return [1].map!(a => range1);
}

auto r = f([1, 2, 3]);

void main() {
    r.writeln;
}
------

Moving r inside main() fixes the problem.

--

Reply via email to