www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 24442] New: [DIP1000] struct member slice cannot point to

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 puremagic.com
          Reporter: johanengelen 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
```

--
Mar 19