scala/scala — pull request #720 by phaller (2012-06-14 15:56:32+00:00)
Title: CPS: enable return expressions in CPS code if they are in tail position

Adds a stack of context trees to AnnotationChecker(s). Here, it is used to
adapt the annotation of a return expression if the expected type is a CPS type.

The remove-tail-return transform is reasonably general, covering cases such as
try-catch-finally. Moreover, an error is thrown if, in a CPS method, a return
is encountered which is not in a tail position such that it will be removed
subsequently.

Review by @adriaanm or @TiarkRompf