Unreachable code after return statement compiles!

I personally like it – when I’m debugging a method and I want to manually return a value early (instead of calculating the value as usual) I can just plop return foo in the middle somewhere and it still works without having to comment out a bunch of code. Plus I doubt they can change it now – some code surely is relying on this behavior, though perhaps they could change it in a new major version. e.g. 1.2.

As for the code itself, well, here’s what I get, which seems painfully obvious to me:


1 Like