scala/scala — pull request #2655 by VladUreche (2013-06-14 14:09:00+00:00)
Title:  SI-7344 Specialize methods in private scopes

This performs method specialization inside a scope other than a {class, trait, object}: could be another method or a value. This specialization is much simpler, since there is no need to record the new members in the class signature, their signatures are only visible locally. It works according to the usual logic:
- we use normalizeMember to create the specialized symbols
- we leave DefDef stubs in the tree that are later filled in by tree duplication and adaptation

The solution is limited by [SI-7579](https://issues.scala-lang.org/browse/SI-7579): since the duplicator loses the sym annotations when duplicating, this expansion and rewiring can only take place in code that has not been subject to duplication. You can see the test case for an example.

Review by @dragos, @paulp or @axel22.

This pull request is based on PR #2651, thus the two extra commits. Any help fixing [SI-7579](https://issues.scala-lang.org/browse/SI-7579) is welcome, I have no good solution for it yet.