Skip to main content

abstract AbstractEagerCollection

Type-erased base for eager collections, enabling sound typing in collection maps.

Under sound subtyping, EagerCollection<K, V> is not assignable to EagerCollection<Json, Json> because EagerCollection uses K and V in both covariant and contravariant positions. This abstract base class erases the type parameters so that collections with different key/value types can be stored together in a NamedEagerCollections map.

Uses a branded field to ensure nominal (not structural) typing.

Extended by​

Constructors​

new AbstractEagerCollection()​

new AbstractEagerCollection(): AbstractEagerCollection

Returns​

AbstractEagerCollection

Properties​

__sk_collectionBrand​

readonly __sk_collectionBrand: undefined;