Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



#scala #variances
Similarly, -T would declare T to be used only in contravariant positions.
If you want to change selection, open document below and click on "Move attachment"

Variances - Scala Documentation
quot;" } object VariancesTest extends App { var s: Stack[Any] = new Stack().push("hello"); s = s.push(new Object()) s = s.push(7) println(s) } The annotation +T declares type T to be used only in covariant positions. <span>Similarly, -T would declare T to be used only in contravariant positions. For covariant type parameters we get a covariant subtype relationship regarding this type parameter. For our example this means Stack[T] is a subtype of Stack[S] if T is a subtype of S.


Summary

statusnot read reprioritisations
last reprioritisation on suggested re-reading day
started reading on finished reading on

Details



Discussion

Do you want to join discussion? Click here to log in or create user.