С Scala новым API отражения, можно ли получить ссылку на объект класса-компаньона? Я думаю что-то в этом духе:
trait Base {
def companion: MetaBase = someReflectionMagic(this).asInstanceOf[MetaBase]
}
trait MetaBase {
// stuff
}
// ---
class Foo extends Base
object Foo extends MetaBase
assert(new Foo.companion == Foo)