scala/scala — pull request #3725 by gkossakowski (2014-05-07 20:51:21+00:00)
Title: Refactor FastTrack to use composition instead of inheritance.

Instead of mixing in FastTrack into Macros trait just have a member
with an instance of FastTrack. The motivation for this change is to reduce
the overall use of inheritance is Scala compiler and FastTrack seems like
a nice target for first step. It's an implementation detail of Scala
compiler that we are free to modify.

Previously, `fastTrack` method would be inherited from FastTrack trait and
called from clients (sub classes). The `fastTrack` method returned Map.
Now, the `fastTrack` viariable is of type `FastTrack`. In order for clients
to continue to work we had to implement three operations called by
clients: contains, apply, get.

Alternatively, we could keep the `fastTrack` method and import it in
clients. This approach is likely to be more common in the future when
bigger pieces of code get refactored.