[Issue 24272] New: operations.arrayOp is forced @nogc nothrow pure

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Dec 7 10:28:04 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=24272

          Issue ID: 24272
           Summary: operations.arrayOp is forced @nogc nothrow pure
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P1
         Component: druntime
          Assignee: nobody at puremagic.com
          Reporter: dkorpel at live.nl

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- at nogc
function
                    // `std.bigint.BigInt.opOpAssign!("+", BigInt).opOpAssign`
}
```

arrayOp is a template, so function attributes should be inferred.

--


More information about the Digitalmars-d-bugs mailing list