Bug 24054 – return expression expected on noreturn function
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2023-07-20T22:17:16Z
Last change time
2023-07-24T07:13:33Z
Keywords
diagnostic, pull
Assigned to
No Owner
Creator
elpenguino+D
Comments
Comment #0 by elpenguino+D — 2023-07-20T22:17:16Z
```
noreturn foo() { return; }
```
As of DMD 2.104.2, this results in "Error: return expression expected". This is a misleading error, and should probably suggest removal of the statement.
Comment #1 by dlang-bot — 2023-07-21T11:14:19Z
@dkorpel created dlang/dmd pull request #15439 "Fix 24054 - return expression expected on noreturn function" fixing this issue:
- Fix 24054 - return expression expected on noreturn function
https://github.com/dlang/dmd/pull/15439
Comment #2 by dkorpel — 2023-07-21T11:23:51Z
> and should probably suggest removal of the statement
That doesn't result in valid code, it needs to be replaced with something typed `noreturn`.
Comment #3 by dlang-bot — 2023-07-24T07:13:33Z
dlang/dmd pull request #15439 "Fix 24054 - return expression expected on noreturn function" was merged into master:
- 01d613ecec3867ee1e71d3f3e08c60de35a41934 by Dennis Korpel:
Fix 24054 - return expression expected on noreturn function
https://github.com/dlang/dmd/pull/15439