https://issues.dlang.org/show_bug.cgi?id=22840
Issue ID: 22840
Summary: [dip1000] inout method with inferred @safe escapes
local data
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
issue 20149 was closed with a partial fix. The fix doesn't work when `@safe` is
inferred, example:
```
struct S
{
int buf;
auto slice() inout
{
return &buf;
}
}
int* fun() @safe
{
S sb;
return sb.slice(); // should error
}
```
Remove `inout` or add explicit `@safe` to `slice` and it correctly raises an
error.
--