Bug 22967 – [dip1000] no return ref inference for extended return semantics

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2022-04-02T14:18:39Z
Last change time
2022-04-06T07:22:27Z
Keywords
pull
Assigned to
No Owner
Creator
Dennis

Comments

Comment #0 by dkorpel — 2022-04-02T14:18:39Z
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; } ```
Comment #1 by dlang-bot — 2022-04-05T15:13:14Z
@dkorpel created dlang/dmd pull request #13952 "Fix issue 22967 - no `return ref` inference for extended return semantics" fixing this issue: - Fix issue 22967 - no return ref inference for extended return semantics https://github.com/dlang/dmd/pull/13952
Comment #2 by dlang-bot — 2022-04-06T07:22:27Z
dlang/dmd pull request #13952 "Fix issue 22967 - no `return ref` inference for extended return semantics" was merged into master: - 13012b879016b03c3d1ff367a860e9f3bf70421a by Dennis Korpel: Fix issue 22967 - no return ref inference for extended return semantics https://github.com/dlang/dmd/pull/13952