Bug 12253 – Built-in sort accepts an array of structs of immutables

Status
RESOLVED
Resolution
WONTFIX
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2014-02-25T07:13:00Z
Last change time
2021-09-08T13:55:18Z
Keywords
accepts-invalid
Assigned to
No Owner
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2014-02-25T07:13:00Z
DMD 2.065 compiles this with no errors: struct Foo { immutable int x; } void main() { Foo[] a; a.sort; }
Comment #1 by bearophile_hugs — 2014-02-25T07:16:00Z
(Problem found by Vladimir Panteleev in Issue 12248 )
Comment #2 by yebblies — 2014-02-28T04:43:32Z
This is probably WONTFIX with builtin sort going away.
Comment #3 by dkorpel — 2021-09-08T13:55:18Z
The sort property was deprecated in 2.072.2 and removed in 2.075.1. `sort` from std.algorithm correctly rejects the code.