Type Covariance and Contravariance Quoting from wikipedia Within the type system of a programming language, covariance and contravariance refers to the ordering of types from narrower to wider and their interchangeability or equivalence in certain situations (such as parameters, generics, and return types). covariant: converting from wider (double) to narrower (float). contravariant: converting from narrower [...]
Posted on