scala/scala — pull request #2715 by magarciaEPFL (2013-07-08 20:47:42+00:00)
Title: constructors phase refactoring (2nd attempt)

The `constructors` phase has grown over time, with sub-transformations being added to the all-encompassing `transformClassTemplate()` on an as-needed basis.

This PR breaks that method apart, encapsulating each sub-transformation in a trait dedicated to it. Documentation has been thrown in, too.

This PR essentially plays again the commits of https://github.com/scala/scala/pull/2599
adapted to `Constructors.scala` in its current form.

Those commits were once merged into master, but had an ephemeral existence:
they were inadvertently *overwritten* by the merge of 2.10.2 into master,
see commit 767a25fe2178b00f494d55bdaae53535cd7fb57d

This PR is a pre-requisite for an upcoming re-submission of https://github.com/scala/scala/pull/2665 ,
to make anon-closures retain fewer heap objects (currently, in some cases, more objects are retained via outer-refs than really needed).

Please merge this PR before Constructors.scala drifts again.

review by @JamesIry