Consider the following code: import std.algorithm : schwartzSort; import std.array : array; struct S { int i; const(int) foo() { return i; } } void main() { auto list = [S(4), S(3), S(2)]; assert(list.dup.schwartzSort!(a => a.foo).array == [S(2), S(3), S(4)]); } This leads to cryptic errors due to the fact that `schwartzSort` does not strip the `const` from `const(int)` for its internal array, even though it trivially could since it's a value type.
@MoonlightSentinel created dlang/phobos pull request #7602 "Fix Issue 21183 - schwartzSort does not strip const" fixing this issue: - Fix Issue 21183 - schwartzSort does not strip const Fixed by using the unqualified type if possible https://github.com/dlang/phobos/pull/7602
dlang/phobos pull request #7602 "Fix Issue 21183 - schwartzSort does not strip const" was merged into stable: - 255f9496d1ef72876613d27341dee483e364aa3d by MoonlightSentinel: Fix Issue 21183 - schwartzSort does not strip const Fixed by using the unqualified type if possible https://github.com/dlang/phobos/pull/7602