Bug 22518 – [dip1000] return without scope/ref not specified
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-11-17T23:28:12Z
Last change time
2021-12-09T21:51:28Z
Keywords
pull
Assigned to
No Owner
Creator
Dennis
Comments
Comment #0 by dkorpel — 2021-11-17T23:28:12Z
I think this should pass:
```
void retsc(return scope int* x);
void ret(return int* x);
static assert(is(typeof(retsc) == typeof(ret)));
```
In the current implementation it doesn't, since `return` adds `scope` with `STC.scopeinferred` so it's not part of the type's mangle. Since it only depends on the signature, not any actual function body inference, I think making this distinction is a needless complication.
I would call this a bug, but since the spec doesn't say anything about `return` without `scope` or `ref`, I'm filing this as a specification issue.
Comment #1 by dlang-bot — 2021-11-17T23:32:06Z
@dkorpel created dlang/dlang.org pull request #3123 "Fix Issue 22518 - return without scope/ref not specified" fixing this issue:
- Fix Issue 22518 - return without scope/ref not specified
https://github.com/dlang/dlang.org/pull/3123
Comment #2 by dlang-bot — 2021-11-29T13:49:15Z
@dkorpel updated dlang/dmd pull request #13317 "Make `return` equivalent to `return scope` for issue 22518" mentioning this issue:
- Make `return` equivalent to `return scope` for issue 22518
https://github.com/dlang/dmd/pull/13317
Comment #3 by dlang-bot — 2021-12-09T14:27:52Z
dlang/dlang.org pull request #3123 "Fix Issue 22518 - return without scope/ref not specified" was merged into master:
- 4b2518527486f9df24d014268a40a7ad4aad04f1 by dkorpel:
Fix Issue 22518 - return without scope/ref not specified
https://github.com/dlang/dlang.org/pull/3123
Comment #4 by dlang-bot — 2021-12-09T21:51:28Z
dlang/dlang.org pull request #3137 "Revert "Fix Issue 22518 - return without scope/ref not specified"" was merged into master:
- 7d21cad3b524f887cdcb4b4b5e4ec615d1cf069b by Razvan Nitu:
Revert "Fix Issue 22518 - return without scope/ref not specified"
https://github.com/dlang/dlang.org/pull/3137