Dart generics variance


Topic | v1 | created by jjones |
Description

Covariant generics fit a common intuition that programmers have, and very often this intuition is correct, such as in the common “read-only” use of a generic. Although this intuition isn’t always correct, Dart is erring on the side of convenience by having covariant generics.


Relations

a subtopic of Dart

Dart is a client-optimized programming language for apps on multiple platforms. It is developed by Go...

is Covariance and contravariance

Many programming language type systems support subtyping. For instance, if the type Cat is a subtype...


Edit topic New topic

Resources

No beginner resources matching your criteria have been registered, yet.

No intermediate resources matching your criteria have been registered, yet.

No advanced resources matching your criteria have been registered, yet.

is treated in Dart declaration-site variance

A deep dive into an experimental feature