[Issue 24442] New: [DIP1000] struct member slice cannot point to other struct member

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 19 20:14:36 UTC 2024


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

          Issue ID: 24442
           Summary: [DIP1000] struct member slice cannot point to other
                    struct member
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: johanengelen at weka.io

Testcase with `-dip1000`:

```
struct S {
    int[10] array;
    int[] slice;

    void foo() @safe {
        slice = array[];
    }
}
```

results in error:
```
<source>(6): Error: address of variable `this` assigned to `this` with longer
lifetime
```

--


More information about the Digitalmars-d-bugs mailing list