Bug 3229 – No return or assert(0) at end of function
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2009-08-05T06:00:00Z
Last change time
2015-06-09T01:28:07Z
Assigned to
nobody
Creator
jason.james.house
Comments
Comment #0 by jason.james.house — 2009-08-05T06:00:38Z
This error pops up incorrectly after a final switch full of return statements.
Comment #1 by bugzilla — 2009-08-05T14:12:20Z
Example, please!
(Yes, I know, why don't I just write one? Because most of the time when I write one and guess at the details, the problem does not occur, because the description omits crucial information.)
Comment #2 by jason.james.house — 2009-08-05T16:53:47Z
Your wish is my demand!
int main(){
enum foo{ bar };
foo x;
final switch(x){ case foo.bar: return 0; }
}
buggy.d(1): Error: function main.main no return exp; or assert(0); at end of function