http://d.puremagic.com/issues/show_bug.cgi?id=8469
Summary: isSorted fails with predicate "a.length < b.length ?
true : a < b"
Product: D
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Jonathan M Davis <[email protected]> 2012-07-29 19:44:44
PDT ---
This code fails the assertion:
import std.algorithm;
import std.stdio;
void main()
{
string[] x = ["_10", "_20", "_100"];
assert(isSorted!"a.length < b.length ? true : a < b"(x));
}
However, it _is_ sorted according to the predicate, so the assertion should
pass.
I ran into this because sort throws an AssertError sorting ["_100", "_10",
"_20"] using that predicate, claiming that the sorting failed, when it actually
succeeded. So, not only is this messing up isSorted, but it messes up sort in
non-release mode.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------