Bug 19744 – Confusing error message when annotating a non-member function with `return`
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-03-16T07:16:06Z
Last change time
2019-03-19T10:36:50Z
Keywords
pull
Assigned to
No Owner
Creator
Meta
Comments
Comment #0 by monkeyworks12 — 2019-03-16T07:16:06Z
@safe
int* test(return scope int* n) return
{
return n;
}
This prints a mildly nonsensical error message:
Error: function `test` static member has no this to which return can apply
Specifically, it is the "function `test` static member` part which is confusing.
Comment #1 by dlang-bot — 2019-03-19T09:28:21Z
@RazvanN7 created dlang/dmd pull request #9466 "Fix Issue 19744 - Confusing error message when annotating a non-memberr function with return" fixing this issue:
- Fix Issue 19744 - Confusing error message when annotating a non-member function with
https://github.com/dlang/dmd/pull/9466
Comment #2 by dlang-bot — 2019-03-19T10:36:50Z
dlang/dmd pull request #9466 "Fix Issue 19744 - Confusing error message when annotating a non-memberr function with return" was merged into master:
- 1988c5da87f279259c905aeb0cfc8c24a777ce9e by RazvanN7:
Fix Issue 19744 - Confusing error message when annotating a non-member function with
https://github.com/dlang/dmd/pull/9466