scala/scala — pull request #994 by phaller (2012-07-25 21:56:12+00:00)
Title: SI-5314 - CPS transform of return statement fails (resubmission of #987)

Enable return expressions in CPS code if they are in tail position. Note that tail returns are
only removed in methods that do not call `shift` or `reset` (otherwise, an error is reported).

Addresses the issues pointed out in a previous pull request:
https://github.com/scala/scala/pull/720

- Addresses all issues mentioned here:
https://github.com/scala/scala/pull/720#issuecomment-6429705

- Move transformation methods to SelectiveANFTransform.scala:
https://github.com/scala/scala/pull/720#commitcomment-1477497

- Do not keep a list of tail returns.

Tests:
- continuations-neg/t5314-missing-result-type.scala
- continuations-neg/t5314-type-error.scala
- continuations-neg/t5314-npe.scala
- continuations-neg/t5314-return-reset.scala
- continuations-run/t5314.scala
- continuations-run/t5314-2.scala
- continuations-run/t5314-3.scala

Review by @TiarkRompf and @adriaanm