What's the difference between A<:B and +B in Scala?

后端 未结 4 1462
挽巷
挽巷 2021-01-29 18:20

What\'s the difference between

[A <: B]

and

[+B]

in Scala?

4条回答
  •  说谎
    说谎 (楼主)
    2021-01-29 18:37

    I found this blog post while researching this question. Gives an even deeper explanation of Scala variance including its theoretical basis in Category Theory

    http://blogs.atlassian.com/2013/01/covariance-and-contravariance-in-scala/

提交回复
热议问题