Repository navigation
Description
A sole generic tuple argument must infer its open elements without rejecting closed elements that the runtime binder can convert. Generated and reflection discovery must agree for boxed, nullable, numeric and nested tuple values. Extract this deliverable from the over-budget PR #7631 without its whole-row/optional-tail inference changes.
Scope
Start from fresh origin/main. Reuse selected reconstruction changes from preserved branch issue-7629-tuple-parity, head 2a1cc3753c847cfc3393accc5b8adae517e75895 (#7631). Own reconstructed-element matching in src/TUnit.Core.SourceGenerator/Generators/TestMetadataGenerator.cs (MatchesOpenRowType reconstruction path), src/TUnit.Engine/Services/TestGenericTypeResolver.cs (TryInferTypeMapping and candidate substitution), and corresponding reflection invocation in src/TUnit.Engine/Discovery/ReflectionTestDataCollector.cs. Own sole-tuple payload boundary/singleton changes in src/TUnit.Engine/Helpers/DataUnwrapper.cs and src/TUnit.Core/Helpers/TestDataRowUnwrapper.cs. Shared files require selected hunks, never whole-file replacement.
Own focused sole-tuple fixtures, generator snapshots, engine integration expectations, helper tests and relevant rule-table documentation. Use static sources for independence. Do not import whole-row matching with optional/params tails or the explicit-method-type wrapper lookup changes owned by the sibling.
Acceptance
- Infer open tuple elements when closed elements need runtime conversions: boxed object-to-int, string parsing, numeric narrowing, enums, IConvertible and user operators; preserve the numeric value as well as its type.
- Preserve structural last-occurrence inference through repeated direct, nullable, array and matching generic elements. Keep ordinary non-tuple inference behavior unchanged.
- Support cross-family Tuple/ValueTuple reconstruction, explicit ValueTuple and singleton/nested singleton boundaries, including TestDataRow payloads.
- Isolate generic interface/base candidate bindings, validate the completed candidate with variance and constraints, and keep strict repeated bindings through nested tuple arguments. A failed candidate must not leak bindings or abort the search.
- Defer unsupported declared-element matches to runtime casts when another element supplies the generic binding, including object/interface/base and array declarations. Keep candidate validation strict and preserve intended inference failures for spread-column controls.
- Reuse and review the relevant fixed findings on Preserve tuple inference and runtime element conversions #7631; the two currently open wrapper findings belong to the whole-row sibling and must not be introduced by this extraction.
- Run a focused shared row/parameter matrix in generated and reflection discovery, affected generator snapshots and helper tests, and verify Native AOT publishing. Update engine integration expectations for CI; do not run the engine integration suite locally. Do not copy the combined 12k-line snapshot wholesale: regenerate only this deliverable's cases.
No dependency on the sibling whole-row deliverable: this change covers a sole tuple data parameter under main's existing row-selection behavior. Matcher maintainability work remains #7588; related repeated-tuple behavior is tracked in #7481 and analyzer false positives in #7622. Supersedes the reconstruction portion of #7629, under parent #7351.
Activity
Infer sole-tuple types through generic containing types (#7639)
Fix sole-tuple inference and conversion parity (#7639)
Infer sole-tuple types through generic containing types (#7639)
Isolate sole-tuple reconstruction inference for #7639
Reject ambiguous sole-tuple interface inference for #7639
Fix explicit sole-tuple discovery parity for #7639
Fix sole-tuple array rank inference parity (#7639)
Preserve sole-tuple inference and runtime conversion parity (#7643)