b.scala:1: error: Companions 'trait Foo' and 'object Foo' must be defined in same file: Found in t1286/a.scala and t1286/b.scala object Foo extends Foo { ^ one error found