Bug 24044 – Support float opCmp(...) with array

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2023-07-11T14:48:42Z
Last change time
2023-07-13T07:52:20Z
Keywords
pull
Assigned to
No Owner
Creator
apham

Comments

Comment #0 by apz28 — 2023-07-11T14:48:42Z
import std.stdio, std.array, std.algorithm; struct Foo { @safe: float opCmp(scope const(Foo) rhs) nothrow { return float.nan; } } void main() { Foo[] a, b; a.length = 1; b.length = 1; writeln(a > b); } getting below error /dlang/dmd/linux/bin64/../../src/druntime/import/core/internal/array/comparison.d(113): Error: cannot implicitly convert expression `c` of type `float` to `int` onlineapp.d(18): Error: template instance `core.internal.array.comparison.__cmp!(Foo, Foo)` error instantiating
Comment #1 by dlang-bot — 2023-07-12T16:20:21Z
@dkorpel created dlang/dmd pull request #15407 "Fix 24044 - Support float opCmp(...) with array" fixing this issue: - Fix 24044 - Support float opCmp(...) with array https://github.com/dlang/dmd/pull/15407
Comment #2 by dlang-bot — 2023-07-13T07:52:20Z
dlang/dmd pull request #15407 "Fix 24044 - Support float opCmp(...) with array" was merged into master: - 6b026900c89d3fc936af71b77609333c7b7397ac by Dennis Korpel: Fix 24044 - Support float opCmp(...) with array https://github.com/dlang/dmd/pull/15407