www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8792] New: std.algorithm.joiner doesn't return a proper forward range`

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

           Summary: std.algorithm.joiner doesn't return a proper forward
                    range`
           Product: D
           Version: D2
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: hsteoh quickfur.ath.cx



import std.algorithm;
import std.range;
import std.stdio;

void main() {
    auto x = [[1],[2],[3]];
    auto yy = x.joiner;

    assert(isForwardRange!(typeof(yy)));
    writeln(yy.save);
    writeln(yy);
}

The output is:

[]
[1, 2, 3]

Which means that yy.save didn't save at all! This is a pretty major bug since
it makes joiner unusable where the result needs to be a forward range.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 09 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8792




Found the bug: joiner.Result.save didn't copy 1 field over, so the saved range
is defective.

https://github.com/D-Programming-Language/phobos/pull/853

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 09 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8792




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

https://github.com/D-Programming-Language/phobos/commit/0c4ebc2ce702ca6e06379d80e78efc9ccb050ced
Fix issue 8792.

std.algorithm.joiner(ror).Result.save fails to copy over _valid_current,
resulting in a defective copy returned by .save.

https://github.com/D-Programming-Language/phobos/commit/d215dabbe2c70e737556933e6820ae5b0bf9ab93
Add unittest for issue 8792.

https://github.com/D-Programming-Language/phobos/commit/a3289101b1561fa6ab87c7d24b14d9839d4f028c


Fix issue 8792

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 13 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8792


Jonathan M Davis <jmdavisProg gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |jmdavisProg gmx.com
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 13 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8792




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

https://github.com/D-Programming-Language/phobos/commit/5a0c67f08553c05c532fe3c433e3bb944d8aa6dd


https://github.com/D-Programming-Language/phobos/commit/5037dd00bd66ee195da3b95dd7a5baa99f451106




-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 14 2012