scala/scala — pull request #2717 by retronym (2013-07-09 07:52:01+00:00)
Title: SI-6754 Support @tailrec for extension methods.

Currently, when the body of an extension method is transplanted
to the companion object, recursive calls point back to the original
instance method. That changes during erasure, but this is too late
for tail call analysis/elimination.

This commit eagerly updates the recursive calls to point to the
extension method in the companion. It also removes the @tailrec
annotation from the original method.

Review by @adriaanm