docs.scala-lang
docs.scala-lang copied to clipboard
Subsection for Immutability and Variance
Proposed the addition of a subsection to Variance explaining the relationship between immutability and variance very briefly with an example. Referenced the related part of the document for immutable/mutable classes. Compared two Collections, List and Array to show why one is covariant while the other is invariant. Based on the discussion Why are Arrays invariant, but Lists covariant?.