Contravariance vs Covariance in Scala
问题 I just learned Scala. Now I am confused about Contravariance and Covariance. From this page, I learned something below: Covariance Perhaps the most obvious feature of subtyping is the ability to replace a value of a wider type with a value of a narrower type in an expression. For example, suppose I have some types Real , Integer <: Real , and some unrelated type Boolean . I can define a function is_positive :: Real -> Boolean which operates on Real values, but I can also apply this function