Skip to content

Order of scanned memebers can influence incremental generators and cause recompilation #24

@dmytroett

Description

@dmytroett

internal sealed record GeneratedInterfaceInfo(
string InterfaceName,
string InterfaceNamespace,
string Accessibility,
ImmutableArray<string> MemberSignatures,
string ClassName,
string ClassNamespace,
string ClassTypeParameters,
int TypeParameterCount,
string TypeParameterConstraints);

The order of members can change which will cause recompilation.

var interfaces = symbol.AllInterfaces
.Where(static iface => !WellKnownInterfacesRegistry.IsWellKnownInterface(iface))
.Distinct(SymbolEqualityComparer.Default)
.ToList();

The order of interfaces is unstable, can cause recompilation if it changes.

The order of members is unstable, therefore generated interface might change and cause unnecessary recompilation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions