[Issue 1169] New: Return statement is not necessary - unreachable
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Apr 20 08:31:35 PDT 2007
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 at digitalmars.com
ReportedBy: arkangath at 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");
}
}
--
More information about the Digitalmars-d-bugs
mailing list