Skip to content

fix: preserve nullable structural collection elements - #40

Merged
AGiorgetti merged 1 commit into
developfrom
fix/codex-26-null-elements
Oct 9, 2026
Merged

AGiorgetti merged 1 commit into
developfrom
fix/codex-26-null-elements

Conversation

@AGiorgetti

@AGiorgetti AGiorgetti commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #26.

  • Preserve null structural elements with a single-evaluation capture before invoking object helpers.
  • Apply NullableMismatchPolicy.Throw before a non-null structural helper call, retaining the element path and InvalidOperationException. Keep the existing LITEMAPPER2003 Error rejection and higher-precedence converter behavior.
  • Preserve nullable collection-helper input annotations. Structural helpers remain non-null.
  • Add 31 generator regression cases and nullable-element examples to source samples, clean-package consumers, the framework/language matrix, and trimming/Native AOT consumers.

Test-first evidence

On unchanged develop 38e313ef836f9400dd0eeaea56d48ba35dca733d, the completed 31-case fixture produced 23 failures and eight passing controls, with no skips. The failures expose NullReferenceException and generated CS8604 warnings. The Collections sample independently failed at runtime.

Coverage includes arrays, lists, enumerable/read-only targets, dictionary values, nested nullable collections, Error/Throw, count/order, single enumeration/getter evaluation, constructor suppression for nulls, Empty strategy independence, patch members, instance converters, recursive/shared references, C# 9 warning-free output, and determinism.

Local validation

  • Release solution build: zero warnings/errors
  • Generator: 727 passed, including all 31 new cases
  • Runtime: five passed
  • Integration: one passed
  • All three source sample smoke runs pass
  • Available packaging suite: 220 passed, two infrastructure failures, zero skips
  • All 12 framework/language package consumers pass, as do clean-package samples, package/API checks, usage validation, and benchmark smoke
  • Generated netstandard2.0 package source inspected; independent review and CRLF-aware diff checks pass
  • Remote tree 2e3ba273489629c6b9605c728677554c0df442c1 matches the tested local tree exactly

Local limits and recovery

PowerShell and clang are unavailable. The final package command excludes 49 PowerShell-dependent cases. Trimming and Native AOT fail at ILLink's ComputeManagedAssemblies task-host creation with MSB4216 / Unix-domain SocketException (13); local publish behavior is not established.

An initial sample was separated into its own mapper to avoid unrelated declared-mapping selection. The package fixture's exact generated-file count was updated from five to six for the added mapper. An interrupted package attempt had no final TRX; the completed retry provides the results above. No diagnostic, assertion, dependency, prerequisite, or security setting was weakened.

CI and review

Ordinary exact-head CI run 37915931192 passed for b509219f9a96f78417f9a6b59e8227c603556dec.

  • Windows: 1,004 tests passed, zero failures/skips (727 generator, 271 packaging, five runtime, one integration)
  • Linux: 1,004 tests passed, zero failures/skips, with the same suite counts
  • Roslyn 4.8.0 / 4.14.0 / 5.9.0 on both operating systems: 727 generator tests passed in each of six jobs, zero failures/skips
  • Full CI packaging includes the PowerShell, trimming, and Native AOT checks unavailable locally; both platform suites pass without skips
  • All three release/publication jobs were skipped as expected for this PR

The PR remains draft, mergeable, and awaiting human review. Work stops at this review checkpoint.

Draft for human review. No merge, release, tag, package publication, or workflow dispatch was performed.

Prepared with OpenAI Codex.

Guard nullable structural elements before object helpers, retaining nullable targets and nested collection input annotations without changing converter precedence.

Fixes #26.

Co-authored-by: Codex <codex@openai.com>
@AGiorgetti
AGiorgetti marked this pull request as ready for review October 9, 2026 10:23
@AGiorgetti
AGiorgetti merged commit 8d41533 into develop Oct 9, 2026
11 checks passed
@AGiorgetti
AGiorgetti deleted the fix/codex-26-null-elements branch October 9, 2026 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P2] Preserve null elements during structural collection mapping

1 participant