Jez Ng Covariance, Contravariance, and super Type Constraints Posted May 28, 2015 Hack has recently enhanced its generics with two features: variance annotations and super type constraints. In this post, I’ll explain how they work and why they were added. Variance Variance describes how the type parameters of a class affect subtyping. For example, consider Vector<T>. Should Vector<int> be a subtyp
![Covariance, Contravariance, and super Type Constraints](https://cdn-ak-scissors.b.st-hatena.com/image/square/9946ab489157bfdf4b2947cef90ba51c14c9a2de/height=288;version=1;width=512/http%3A%2F%2Fhhvm.com%2Fstatic%2Fog_image.png)