[Issue 17091] New: std.range.zip cannot "save" correctly
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sun Jan 15 09:30:36 PST 2017
https://issues.dlang.org/show_bug.cgi?id=17091
Issue ID: 17091
Summary: std.range.zip cannot "save" correctly
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: critical
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: enjouzensyou.boinc at gmail.com
Following code cannot be done correctly.
I tested the following code on DMDv2.072.2.
The line of the 4th `writeln` should output "[Tuple!(int, int)(1, 4),
Tuple!(int, int)(2, 5), Tuple!(int, int)(3, 6)]".
----
import std.range;
import std.algorithm;
import std.stdio;
void main()
{
auto s1 = [1, 2, 3].inputRangeObject;
auto s2 = [4, 5, 6].inputRangeObject;
writeln(s1.save); // [1, 2, 3], OK
writeln(s2.save); // [1, 2, 3], OK
auto added = s1.zip(s2);
writeln(zs.save); // [Tuple!(int, int)(1, 4), Tuple!(int, int)(2, 5),
Tuple!(int, int)(3, 6)], OK
writeln(zs.save); // [], NG
}
----
--
More information about the Digitalmars-d-bugs
mailing list