www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23208] New: [dip1000] missing return scope inference after

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

          Issue ID: 23208
           Summary: [dip1000] missing return scope inference after
                    parameter assignment
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: dkorpel live.nl

This should fail with `-preview=dip1000`:
```
int* rsfail()(scope int* p, int* r)  safe
{
    r = p;
    return r; // should infer return scope on p
}

int* escape()  safe
{
    int i;
    return rsfail(&i, null); // passes
}
```

--
Jun 23 2022