Michel Fortin wrote:
<snip>
That should be filled as a bug.

Technically it isn't a bug: the rule in the spec is

http://www.digitalmars.com/d/1.0/statement.html#ReturnStatement
"At least one return statement, throw statement, or assert(0) expression is required if the function specifies a return type that is not void, unless the function contains inline assembler code."

However, I do think it ought to be instead

"At least one return statement is required if the function specifies a return type that is not void, unless all possible paths through the code lead to a throw statement or assert(0) or the function contains inline assembler code."

Additionally or alternatively, one could add a further restriction: "At least one return statement [...] that is not within a catch or scope(failure) block is required"...

Stewart.

Reply via email to