www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 24272] New: operations.arrayOp is forced nogc nothrow pure

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

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

--
Dec 07 2023