Skip to content

Share generic-method inference precedence and source selection between discovery modes #7450

Closed

Description

@thomhurst

Generic method inference currently implements source ordering and duplicate-source selection separately in the source generator and reflection discovery. Share these decisions so future changes apply to both discovery modes. This is the independently mergeable generic-method portion of #7371.

Scope

  • Define one internal policy for generic-method source precedence: Arguments, typed data sources, parameter inference attributes, MethodDataSource, then GenerateGenericTest.
  • Share duplicate-source joining and declared-type constraint fallback decisions between both modes.
  • Document the rules and cover them with one parity matrix exercised in both modes.
  • Preserve existing discovery behavior and keep Roslyn/reflection type extraction in their respective adapters.

Acceptance criteria

Both discovery modes consume the shared policy; the matrix covers ordering, duplicate sources, explicit types, and fallback. Relevant generator snapshots and targeted fixtures pass. Class inference and class/method pairing remain in the sibling class-policy issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low: cleanup, minor enhancement, or rare edge caseenhancementNew feature or requestin-progressWork is in progress

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions