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.
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.Childand the updater invocation reads it again. Relevant logic begins atsrc/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
NullableMismatch.Throw.Specification references
Sections 9.4, 11.4, 12.4, 14.4, 16.1, and 22.13.