https://issues.dlang.org/show_bug.cgi?id=22910
Issue ID: 22910
Summary: [dip1000] return scope struct member functions allow
returning `this` by ref
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: safe
Severity: normal
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
This should give an error since the function is `return scope`, while it should
be `return ref` for returning a reference to `this`:
```
struct S
{
int val;
int* ptr;
int* retScope() return scope
{
return &this.val;
}
}
```
--