Skip to content

Create an internal sorted equatable collection type for incremental source generators #89318

@layomia

Description

@layomia

Based on feedback from @eiriktsarpalis.

ImmutableEquatableArray<T> implements sequence equality. The JSON generator uses it in its specs to make incremental generation possible. However, spec collections often need to have set-like semantics to retain equality & avoid regeneration when there are compilation diffs that don't affect the effective inputs to the generator. IOW we want to avoid false negatives in the incremental cache.

An upcoming PR to enable incremental generation for the config binding generator (#83534) will share this type. As a follow up to that PR, we should create a new type (say ImmutableEquatableSet<T>) that guarantees set semantics by construction, following the implementation of SortedList<T>. This would avoid false negatives in the incremental cache.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions