Another thread on why parametric types are invariant: Reason behind designing parametric types as invariant. Note that these covariance and contravariace relations hold:
- covariance:
S <: T
⇒P{<:S} <: P{<:T}
- invariance:
S ≠ T
⇒ ¬P{S} <: P{T}
- contravariance:
S <: T
⇒P{>:S} >: P{>:T}