Skip to content

Cover single evaluation of direct nullable nested-updater sources #13

Description

@AGiorgetti

Summary

Direct nullable source members passed to explicitly selected nested update mappings need a regression proving single evaluation under NullableMismatch.Throw.

Evidence

The nested-updater branch only creates a capture for configured paths. For a direct nullable source member, the generated precondition reads source.Child and the updater invocation reads it again. Relevant logic begins at src/Mammoth.LiteMapper.Generator/LiteMapperGenerator.cs:745, with the precondition path at line 771 and update assignment rendering at line 4150.

Risk

A side-effecting direct source getter can run twice before the nested updater is invoked, violating the source-path and existing-target single-evaluation contract.

Acceptance criteria

  • Add a regression with a direct nullable source property whose getter records invocation count.
  • Exercise an explicitly selected nested updater under NullableMismatch.Throw.
  • Assert the generated mapping evaluates the source property exactly once for both non-null and null behavior.
  • If the regression fails, apply the smallest generator fix that preserves patch/nullability semantics.
  • Verify focused nested-update tests and required full validation suite pass.

Specification references

Sections 9.4, 11.4, 12.4, 14.4, 16.1, and 22.13.

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

    exec:agentAgentStack execution mode: agentpriority:p2AgentStack priority P2ready:agentAgentStack readiness: ready for agentstate:doneAgentStack protocol state: donetype: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