scala/scala — pull request #3446 by retronym (2014-01-31 21:09:19+00:00)
Title: Optimize handoff namer -> typer tree handoff

Use tree attachments, rather than a global hashmap, to record
the results of computing inferred types in Namer.

For cases when no transform occurs (the typer mutates a Literal
tree in-place by just setting its type), this leads to a minor
change in behaviour in the interaction with plugins: they will
be asked a second time to amend the type. This stems from the
fact that Typers uses a lazy tree copier.

I have encapsulated the way this handoff is handled in
`unit.transformed`. If we want to try a different strategy
(perhaps `AnyRefMap`?), we have a single place to change.

Review by @gkossakowski