From fdaabf253e52dcae9d850a1b900d4fd964fd6016 Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Fri, 12 Dec 2025 11:42:08 +0000 Subject: [PATCH] Avoid op= on struct rvalue Use `opOpAssign` directly instead, which is in the spec: > an instance method can still be called on an rvalue struct instance, even if the method is not const https://dlang.org/spec/struct.html#member-functions --- source/mir/bignum/fixed.d | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/mir/bignum/fixed.d b/source/mir/bignum/fixed.d index 54920761..d83d155b 100644 --- a/source/mir/bignum/fixed.d +++ b/source/mir/bignum/fixed.d @@ -963,7 +963,7 @@ UInt!(size + size_t.sizeof * 8) extendedMul(size_t size)(UInt!size a, size_t b) @safe pure nothrow @nogc { - size_t overflow = a.view *= b; + size_t overflow = a.view.opOpAssign!"*"(b); auto ret = a.toSize!(size + size_t.sizeof * 8); ret.data[$ - 1] = overflow; return ret; @@ -1060,6 +1060,7 @@ UInt!(size + size_t.sizeof * 8) { auto ret = extendedMul(a, b); auto view = ret.view; - view.coefficients[$ - 1] += view.topLeastSignificantPart(a.data.length) += c.view; + view.coefficients[$ - 1] += + view.topLeastSignificantPart(a.data.length).opOpAssign!"+"(c.view); return ret; }