Skip to content

ImmutableList inconsistency with List #110081

@bartlomiej-dawidow

Description

@bartlomiej-dawidow

ImmutableList is implemented as a tree which is confusing. Judging by its name, the user of this class likely expects performance characteristics similar to a List. Anecdotally we regularly find instances in our project's code where someone unintentionally used an ImmutableList instead of an ImmutableArray.

The proposed solution is to add a FrozenList class, complementing the existing FrozenDictionary and FrozenSet classes, backed by an array and with the same computational complexity as List.

In addition to the above consider renaming ImmutableList to ImmutableTreeList but that would break backward compatibility.

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions