www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1169] New: Return statement is not necessary - unreachable

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1169

           Summary: Return statement is not necessary - unreachable
           Product: D
           Version: 1.012
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: minor
          Priority: P3
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: arkangath gmail.com


The following function gives out the error "no return at the end of function".
Such is not necessary because the end brecket "}" is unreachable.

private final class TreeNode
{
private TreeNode lChild, rChild, bNeigh, lNeigh, rNeigh;
public TreeNode getNode(tNode request)
{
switch (request)
{
case tNode.lChild: return lChild;
case tNode.rChild: return rChild;
case tNode.bNeigh: return bNeigh;
case tNode.lNeigh: return lNeigh;
case tNode.rNeigh: return rNeigh;
default: assert(false, "Requested inexistent node");
}
}


-- 
Apr 20 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1169


smjg iname.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |smjg iname.com





That's not the error I get:

bz1169.d(17): } expected following member declarations in aggregate

and even more after I fixed the typo that caused this.  Please post code
samples that the reader can test straight off.

But looking at the problem you report, it would appear to have the same root
cause as issue 252.


-- 
Apr 20 2007
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1169


bugzilla digitalmars.com changed:

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







*** This bug has been marked as a duplicate of 252 ***


-- 
Jul 01 2008