Bug 10405 – redundant "expression has no effect" error when returning non-void in void function

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-06-18T08:31:00Z
Last change time
2013-06-19T05:35:11Z
Keywords
diagnostic, pull
Assigned to
nobody
Creator
henning

Comments

Comment #0 by henning — 2013-06-18T08:31:38Z
void main() { return 10; } ------- main.d(2): Error: long has no effect in expression (10) main.d(2): Error: cannot return non-void from void function -------
Comment #1 by henning — 2013-06-18T08:37:12Z
Comment #2 by github-bugzilla — 2013-06-19T04:59:02Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/e51a5b9a9576cb7e9a4d964c1b9a7373fbd65124 fix issue 10405 - redundant "expression has no effect" error when returning non-void in void function https://github.com/D-Programming-Language/dmd/commit/3527e7d9a7b8d12c7159ec759e76413b2ffe7236 Merge pull request #2210 from hpohl/10405 fix issue 10405 - redundant "expression has no effect" error when returning non-void in void function