Skip to content

Fix symbol-accurate declared-cycle tracking for overloaded mappings #12

Description

@AGiorgetti

Summary

Declared-cycle analysis keys generated mappings by method name, and tracker argument injection rewrites generated expression text by name. Overloaded mapping methods can therefore be falsely identified as recursive or receive tracker arguments intended for another overload.

Evidence

FindRecursiveDeclaredMappingNames groups models by Method.Name at src/Mammoth.LiteMapper.Generator/LiteMapperGenerator.cs:3898. Call detection and tracker-call injection use textual searches beginning at lines 4268 and 4321.

Impact

A ThrowOnCycle mapper with overloaded generated Map methods can allocate a tracker for an acyclic graph. A compatible marked converter overload such as Map(string) may be rewritten with unsupported tracker/path parameters, causing consumer compilation failure.

Acceptance criteria

  • Add a failing compile-and-run regression with overloaded declared mappings and a converter overload sharing the method name.
  • Identify declared mapping graph vertices and call edges by symbol identity/signature, not method name or rendered expression text.
  • Forward tracker state only through actual recursive declared mapping edges.
  • Preserve the no-tracker-allocation guarantee for non-recursive public mappings.
  • Verify focused recursion tests and required full validation suite pass.

Specification references

Sections 14.1, 17.1-17.6, 19.8, 21.4, and 22.14.

Activity

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

    claim:activeAgentStack active claim markerexec:agentAgentStack execution mode: agentpriority:p1AgentStack priority P1ready:agentAgentStack readiness: ready for agentstate:pr-openAgentStack protocol state: pr-opentype:bugAgentStack work item type: bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions