Bug 23553 – opCmp spec is incomplete

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-12-13T14:40:02Z
Last change time
2022-12-16T16:14:45Z
Keywords
pull
Assigned to
No Owner
Creator
Grim Maple

Comments

Comment #0 by grimmaple95 — 2022-12-13T14:40:02Z
The spec page for `opCmp` (https://dlang.org/spec/operatoroverloading.html#compare) doesn't tell what values should be returned from it
Comment #1 by dkorpel — 2022-12-13T15:47:05Z
It shows a table with rewrites such as: a < b | a.opCmp(b) < 0 Doesn't that tell you that it should be a negative number when a < b?
Comment #2 by grimmaple95 — 2022-12-13T19:20:17Z
Apparently, it was obscure enough for me to not figure this out. Maybe, a rephrase is needed, or an added table of what the function should return.
Comment #3 by maxhaton — 2022-12-13T20:25:35Z
I agree with Grim. Existing lowering docs is fine but an example even more fine
Comment #4 by dlang-bot — 2022-12-16T07:56:12Z
@RazvanN7 created dlang/dlang.org pull request #3474 "Fix Issue 23553 - opCmp spec is incomplete" fixing this issue: - Fix Issue 23553 - opCmp spec is incomplete https://github.com/dlang/dlang.org/pull/3474
Comment #5 by dlang-bot — 2022-12-16T16:14:45Z
dlang/dlang.org pull request #3474 "Fix Issue 23553 - opCmp spec is incomplete" was merged into master: - 48263a38d0b9491c07361c9b7e6b22625d1ecb14 by RazvanN7: Fix Issue 23553 - opCmp spec is incomplete https://github.com/dlang/dlang.org/pull/3474