docs.scala-lang icon indicating copy to clipboard operation
docs.scala-lang copied to clipboard

Subsection for Immutability and Variance

Open KarahanS opened this issue 3 years ago • 0 comments

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?.

KarahanS avatar Jul 12 '22 14:07 KarahanS