[Issue 19981] New: std.algorithm.iteration.group fails when element type has a const/immutable member

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jun 18 08:38:29 UTC 2019


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

          Issue ID: 19981
           Summary: std.algorithm.iteration.group fails when element type
                    has a const/immutable member
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: elpenguino+D at gmail.com

```
unittest {
    import std.algorithm.iteration : group;
    static struct X {
        const int x;
    }
    X[] arr = [X(1),X(2),X(3)];
    group(arr);
}
```
Currently (DMD 2.086.1) this produces an unhelpful error: Error: cannot modify
struct instance `this._current` of type `Tuple!(X, uint)` because it contains
`const` or `immutable` members

--


More information about the Digitalmars-d-bugs mailing list