lampepfl/dotty — pull request #67 by odersky (2014-03-13 14:19:48+00:00)
Title: Bullet-proofing companionclass/module

Companion class/module computations now also work for local classes and modules. It suffices that some enclosing
context refers to a tree that contains the companions.

The idea is that for local classes we locate companions by locating the statement sequence that defines
the local classes from the context. To be able to do this, the policy for managing Namer/Typer attachments
has changed: We now keep SymOfTree and ExpandedTree in untyped trees, so that we can map undtyped trees to the list of
symbols they define (note that during type-checking, contexts refer to untyped trees, not typed ones).

These attachments are retained only for untyped trees. If a tree has a type it will not have one of the namer/typer
attachments after type checking. To achieve this, there's a symGC method that gets rid of redundant SymOfTree attachments.