https://issues.dlang.org/show_bug.cgi?id=14106
Issue ID: 14106
Summary: sort is @safe in release mode, @system in debug mode
Product: D
Version: D2
Hardware: x86
OS: Mac OS X
Status: NEW
Severity: enhancement
Priority: P1
Component: DMD
Assignee: [email protected]
Reporter: [email protected]
Repro:
@safe void main()
{
import std.algorithm : sort;
import std.range : zip;
int[] a = [ 1, 2, 3 ];
string[] b = [ "a", "b", "c" ];
sort!((c, d) => c[0] > d[0])(zip(a, b));
assert(a == [ 3, 2, 1 ]);
assert(b == [ "c", "b", "a" ]);
}
Fails to compile with -debug, works otherwise.
--