Bug 24272 – operations.arrayOp is forced @nogc nothrow pure

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2023-12-07T10:28:04Z
Last change time
2023-12-07T11:41:46Z
Keywords
pull
Assigned to
No Owner
Creator
Dennis

Comments

Comment #0 by dkorpel — 2023-12-07T10:28:04Z
Pointed out on the forum: https://forum.dlang.org/post/[email protected] ``` void main() { auto a = new BigInt[](100); a[] = BigInt(1); // works fine a[] += BigInt(1); // Error: `@nogc` function `core.internal.array.operations.arrayOp! // (BigInt[], BigInt, "+=").arrayOp` cannot call non-@nogc function // `std.bigint.BigInt.opOpAssign!("+", BigInt).opOpAssign` } ``` arrayOp is a template, so function attributes should be inferred.
Comment #1 by dlang-bot — 2023-12-07T10:30:47Z
@dkorpel created dlang/dmd pull request #15890 "Fix 24272 - operations.arrayOp is forced @nogc nothrow pure" fixing this issue: - Fix 24272 - operations.arrayOp is forced @nogc nothrow pure https://github.com/dlang/dmd/pull/15890
Comment #2 by dlang-bot — 2023-12-07T11:41:46Z
dlang/dmd pull request #15890 "Fix 24272 - operations.arrayOp is forced @nogc nothrow pure" was merged into master: - 9e39e6916f5f13fd08bc929839c0a9ba9f4ee3e1 by Dennis Korpel: Fix 24272 - operations.arrayOp is forced @nogc nothrow pure https://github.com/dlang/dmd/pull/15890