Generalize leak avoidance
Generalize leak avoidance

Leaks can be avoided by following type aliases. Previously, this was only
done if the checked symbol is a term. But it is not clear why types should
not get the same treatment. This avoids a problem in pos/reference/exports.scala.

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