https://issues.dlang.org/show_bug.cgi?id=22967
Issue ID: 22967
Summary: [dip1000] no return ref inference for extended return
semantics
Product: D
Version: D2
Hardware: x86
OS: Windows
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
When returning a parameter by assignment to the first ref parameter, return
scope can be inferred when it's a template/auto function. This is not the case
for return ref yet:
```
@safe:
struct S()
{
int* x;
this(scope int* x) { this.x = x; } // return scope inferred
this(ref int x) { this.x = &x; } // no return ref inferred, error
}
void main()
{
S!() s;
}
```
--