Bug 18963 – Relax restrictions on 'return' parameters when parameter is not a pointer
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-06-09T20:59:48Z
Last change time
2021-04-10T11:44:34Z
Assigned to
No Owner
Creator
Walter Bright
Comments
Comment #0 by bugzilla — 2018-06-09T20:59:48Z
Consider:
T Identity(T)(return T t) { return t; }
void bar(int i, void* p) {
Identity(p); // no error
Identity(i); // Error: parameter t is return but function
// does not return any indirections
}
The error unreasonably impairs the creation of generic code, and so 'return' should simply be ignored for such cases.
dlang/dmd pull request #12418 "[dmd-cxx] fix Issue 18963 - Relax restrictions on 'return' parameters when parameter is not a pointer" was merged into dmd-cxx:
- 07a419b3bff45ce79526cb67c913e3bf8c0540c0 by Walter Bright:
[dmd-cxx] fix Issue 18963 - Relax restrictions on 'return' parameters when parameter is not a pointer
https://github.com/dlang/dmd/pull/12418