Skip to content

Find a record's synthesized members through IRecordFacet, not by name #222

Open

Description

@CaffeinatedCoder

Goal

Replace the name-based lookup of a record's synthesized members in the aspects with Metalama 2027.0's record facet. Needs #173.

ValueObjectDeclaration.cs finds a hand-written PrintMembers by name (method is { Name: "PrintMembers", ... }, around line 389). Metalama 2027.0 adds INamedType.Facets, where IRecordFacet exposes the members the compiler synthesizes for a record: EqualityContract, PrintMembers, the copy constructor and Deconstruct (release notes, "Type facets").

To measure

  • Whether the facet identifies a user-declared PrintMembers, which replaces the synthesized one, or only the synthesized members. If it can't tell them apart, the name lookup stays and this closes as not planned.
  • Any other lookup of a record member by name in src/CodoMetis.TypeKit.Generators (git grep for the names above), handled the same way.

Done when

The same answers on the existing tests over the record shapes of the generated-type axes, with the lookup going through the facet. This is a refactor with no behaviour change, shown by a seeded hand-written PrintMembers in a base record still being reported.

Activity

  1. added this to the 2.5.0 milestone on Oct 31, 2026
  2. added
    choreBuild, CI, tooling, packaging, refactoring with no behaviour change
    package/generatorsAffects CodoMetis.TypeKit.Generators
    area/value-objectsValue-object contracts and what the aspects generate for them
    on Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/value-objectsValue-object contracts and what the aspects generate for themchoreBuild, CI, tooling, packaging, refactoring with no behaviour changepackage/generatorsAffects CodoMetis.TypeKit.Generators

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions