Bug 4861 – Zip-sorting broken

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2010-09-13T10:05:00Z
Last change time
2010-09-13T15:59:18Z
Assigned to
nobody
Creator
dsimcha

Comments

Comment #0 by dsimcha — 2010-09-13T10:05:33Z
Latest SVN release of Phobos (1993), DMD 2.048, must be run w/ asserts enabled: import std.algorithm, std.range; void main() { auto a = [5,4,3,2,1]; auto b = [3,1,2,5,6]; auto z = zip(a, b); sort!"a.field[0] < b.field[0]"(z); } core.exception.AssertError@d:\dmd2\windows\bin\..\..\src\phobos\std\algorithm.d(5187): Zip!(int[],int[]): [Tuple!(int,int)(4, 1) Tuple!(int,int)(5, 3) Tuple!(int,int)(3, 2) Tuple!(int,int)(1, 6) Tuple!(int,int)(2, 5)] For some reason the zip-sorting case used in the Zip unittest seems to miss this bug, but it occurs on almost all real-world inputs.
Comment #1 by andrei — 2010-09-13T15:59:18Z