Perhaps a warning, there are to many ways to make "unreachable" code reachable. In other words, it is surely too much work to implement currently. Plus I find it annoying in Java when that happens, because often I'm just quickly testing a different return.
-Rory On Mon, Sep 19, 2011 at 2:06 AM, Stewart Gordon <[email protected]> wrote: > On 31/08/2011 09:56, Don wrote: > <snip> > >> What if range.empty is simply the compile-time constant 'false'? >> > > That's exactly the case I've just covered. > > Isn't: >> if (false) {...} >> unreachable code? >> If it doesn't create an error, what would? >> > > doSomething(); > return; > doSomethingElse(); > > including more complicated equivalents like > > if (condition) { > return something; > } else { > return somethingElse; > } > doSomethingElse(); > > Stewart. >
