Use-Site Variance
Type projections.
Use-Site Variance
Sometimes a generic class is invariant overall, but a specific function only produces or only consumes the type. Use-site variance (type projections) applies out or in right at the place a type is used.
Why Use-Site Variance
An invariant class like MutableList<T> cannot be made covariant at declaration because it both reads and writes T. But a particular function might only read from it, and projections let us express that safely.