SI-8134 SI-5954 Fix companions in package object under separate comp.

Review by @odersky