Bug 1169 – Return statement is not necessary - unreachable
Status
RESOLVED
Resolution
DUPLICATE
Severity
minor
Priority
P3
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2007-04-20T10:31:00Z
Last change time
2014-02-16T15:25:39Z
Keywords
diagnostic
Assigned to
bugzilla
Creator
arkangath
Comments
Comment #0 by arkangath — 2007-04-20T10:31:34Z
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");
}
}
Comment #1 by smjg — 2007-04-20T21:06:28Z
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.
Comment #2 by bugzilla — 2008-07-01T23:21:53Z
*** This bug has been marked as a duplicate of 252 ***