You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think this section is either wrong or misleading:
This means that if you have a container defined as Box[A], and then use it with a Fruit in place of the type parameter A, you will not be able to insert an Apple (which IS-A Fruit) into it.
Of course I can do:
caseclassBox[A](value : A)
varxf:Box[Fruit] =Box(Apple)
but cannot do:
valxa:Box[Apple.type] =Box(Apple)
xf = xa
Maybe the sentence should read along the lines of:
This means that if you have a container defined as Box[A], and then expect a Box[Fruit], you will not be able to use Box[Apple], which is a fruit, because Box is invariant in the type parameter A.
And I just want to mention that the blog post is a very nice resource! I come to it or refer it fairly frequently. Thanks for putting it up.
The text was updated successfully, but these errors were encountered:
I think this section is either wrong or misleading:
Of course I can do:
but cannot do:
Maybe the sentence should read along the lines of:
And I just want to mention that the blog post is a very nice resource! I come to it or refer it fairly frequently. Thanks for putting it up.
The text was updated successfully, but these errors were encountered: