Covariance and contravariance (computer science): Difference between revisions

Content deleted Content added
Lead does not seem to match wiki guidelines
Line 1:
{{Short description|Programming language concept}}{{Lead rewrite|date=March 2025}}{{Type systems}}
{{Type systems}}
Many [[programming language]] [[type system]]s support [[subtyping]]. For instance, if the [[type (computer science)|type]] {{C sharp|Cat}} is a subtype of {{C sharp|Animal}}, then an [[expression (computer science)|expression]] of type {{C sharp|Cat}} [[Liskov_substitution_principle|should be substitutable]] wherever an expression of type {{C sharp|Animal}} is used.