D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3229 - No return or assert(0) at end of function
Summary: No return or assert(0) at end of function
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other All
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-05 06:00 UTC by Jason House
Modified: 2015-06-09 01:28 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Jason House 2009-08-05 06:00:38 UTC
This error pops up incorrectly after a final switch full of return statements.
Comment 1 Walter Bright 2009-08-05 14:12:20 UTC
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 Jason House 2009-08-05 16:53:47 UTC
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
Comment 3 Walter Bright 2009-08-06 13:04:34 UTC
Thank you, that hits the spot!
Comment 4 Walter Bright 2009-09-03 13:43:38 UTC
Fixed dmd 2.032