transpile: Convert final return statement into tail expression
- Fixes #1506.
- Fixes #1496.
I ran into an unexpected snag with this one: the stmts_block helper function is adding back the semicolon if it's missing. Ideally I would just remove that behaviour, but that has the obvious potential to break a lot of things, so does anyone know why it's there and what other things rely on it?
I was able to remove the semicolon-adding code from stmts_block without any adverse effects in the tests, so let's hope it wasn't needed anywhere else. I think this is ready for review now.
In order to solve #1506 I had to add another variant to the ImplicitReturnType enum, because with Void it was adding a return that doesn't belong there. I don't know if that's actually the correct solution here. I don't quite understand the label break stuff in the compound statements translation, and there is likely some interaction with #1509 as well.