www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7948] New: std.range.zip broken with requireSameLength

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

           Summary: std.range.zip broken with requireSameLength
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: jens.k.mueller gmx.de



unittest                                                                        
{                                                                               
    import std.algorithm;                                                       
    import std.range;                                                           
    int[] a = [ 1, 2, 3 ];                                                      
    string[] b = [ "a", "b", "c" ];                                             
    sort!("a[0] > b[0]")(zip(StoppingPolicy.requireSameLength, a, b));          
    assert(a == [ 3, 2, 1 ]);                                                   
    assert(b == [ "c", "b", "a" ]);                                             
}

fails with
phobos/std/range.d(3563): Invalid Zip object

but is expected to pass (the provided ranges have the same length). The
checking code in range.d is wrong.

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


SomeDude <lovelydear mailmetrash.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lovelydear mailmetrash.com



PDT ---
For convenience, same code as above:

import std.algorithm;                                                       
import std.range; 

void main(){                                                          
    int[] a = [ 1, 2, 3 ];                                                      
    string[] b = [ "a", "b", "c" ];                                             
    sort!("a[0] > b[0]")(zip(StoppingPolicy.requireSameLength, a, b));          
    assert(a == [ 3, 2, 1 ]);                                                   
    assert(b == [ "c", "b", "a" ]);    
}

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




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

https://github.com/D-Programming-Language/phobos/commit/61012d929e14815419e81130d8aa0a55e2119fa1
Fix issue 7948

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


Fix issue 7948

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




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

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


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


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: -------
Jul 01 2012