Avoid recomputation of companionRefs
Avoid recomputation of companionRefs

The previous condition for caching companionRefs contained a condition

    result.companionRefs.forall(implicitScopeCache.contains)

which was always false because we cache types in `implicitCodeCache`, not
companion refs. The new logic fixes this and does not need a second traversal
because it is integrated in `iscopeRefs`.

lampepfl/dotty,dotty-staging/dotty,sjrd/dotty,sjrd/dotty,lampepfl/dotty,sjrd/dotty,dotty-staging/dotty,som-snytt/dotty,dotty-staging/dotty,som-snytt/dotty,dotty-staging/dotty,lampepfl/dotty,som-snytt/dotty,som-snytt/dotty,lampepfl/dotty,sjrd/dotty,sjrd/dotty,dotty-staging/dotty,lampepfl/dotty,som-snytt/dotty