Thread overview
[Issue 3229] New: No return or assert(0) at end of function
Aug 05, 2009
Walter Bright
Aug 05, 2009
Jason House
Aug 06, 2009
Walter Bright
Sep 03, 2009
Walter Bright
August 05, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3229

           Summary: No return or assert(0) at end of function
           Product: D
           Version: 2.031
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: jason.james.house@gmail.com


This error pops up incorrectly after a final switch full of return statements.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
August 05, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3229


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com




--- Comment #1 from Walter Bright <bugzilla@digitalmars.com>  2009-08-05 14:12:20 PDT ---
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.)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
August 05, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3229





--- Comment #2 from Jason House <jason.james.house@gmail.com>  2009-08-05 16:53:47 PDT ---
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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
August 06, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3229





--- Comment #3 from Walter Bright <bugzilla@digitalmars.com>  2009-08-06 13:04:34 PDT ---
Thank you, that hits the spot!

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 03, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3229


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




--- Comment #4 from Walter Bright <bugzilla@digitalmars.com>  2009-09-03 13:43:38 PDT ---
Fixed dmd 2.032

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------