Type variance
= Type variance
How <subtyping> between parameter types affects <subtyping> between instances of a parameterized type. A <covariant type parameter> preserves the direction, a <contravariant type parameter> reverses it, and <generic type invariance> permits neither conversion solely from the parameter relationship. Safe variance depends on how a type is consumed, produced and stored.