Thread overview |
---|
April 20, 2007 [Issue 1169] New: Return statement is not necessary - unreachable | ||||
---|---|---|---|---|
| ||||
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"); } } -- |
April 21, 2007 [Issue 1169] Return statement is not necessary - unreachable | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=1169 smjg@iname.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |smjg@iname.com ------- Comment #1 from smjg@iname.com 2007-04-20 21:06 ------- 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. -- |
July 02, 2008 [Issue 1169] Return statement is not necessary - unreachable | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=1169 bugzilla@digitalmars.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |DUPLICATE ------- Comment #2 from bugzilla@digitalmars.com 2008-07-01 23:21 ------- *** This bug has been marked as a duplicate of 252 *** -- |
Copyright © 1999-2021 by the D Language Foundation