Issue 24272 - operations.arrayOp is forced @nogc nothrow pure
Summary: operations.arrayOp is forced @nogc nothrow pure
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: druntime (show other issues)
Version: D2
Hardware: All All
: P1 minor
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2023-12-07 10:28 UTC by Dennis
Modified: 2023-12-07 11:41 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Dennis 2023-12-07 10:28:04 UTC
Pointed out on the forum: 

https://forum.dlang.org/post/lssjxaqshkvytbeeyoic@forum.dlang.org

```
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 Dlang Bot 2023-12-07 10:30:47 UTC
@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 Dlang Bot 2023-12-07 11:41:46 UTC
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