scala/scala — pull request #592 by retronym (2012-05-20 22:07:02+00:00)
Title: Consider method-scoped companions in the implicit scope.

Fixes SI-4975.

I'll reproduce a relevant snippet of dialogue from Namers#companionSymbolOf:

/** The companion class or companion module of `original`.
* Calling .companionModule does not work for classes defined inside methods.
*
* !!! Then why don't we fix companionModule? Does the presence of these
* methods imply all the places in the compiler calling sym.companionModule are
* bugs waiting to be reported? If not, why not? When exactly do we need to
* call this method?
*/
def companionSymbolOf(original: Symbol, ctx: Context): Symbol = {

This was one such bug.

Hasn't been through a full build; delegating that to build-bot.

Review by @adriaanm / @paulp
- performance ?