Isn't the argument type co- not contra-variant?

后端 未结 4 1257
抹茶落季
抹茶落季 2020-12-03 05:12

I understand the terms co-variance and contra-variance. But there is one small thing I am unable to understand. In the course \"Functional Programming in Scala\" on coursera

4条回答
  •  天涯浪人
    2020-12-03 05:59

    Converting Dog to Animal is converting narrow to wider, so it's not covariance.

提交回复
热议问题