You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test: parity test for typed-row type inference across source-gen and reflection #7386
Merged PR #7343 (#7214) added two implementations of the typed-row binding rules for generic test methods, and they must stay in sync:
InferMethodTypeArgumentsFromRowType in src/TUnit.Core.SourceGenerator/Extensions/TypedDataSourceInference.cs works on Roslyn symbols.
InferTypesFromTypedRow in src/TUnit.Engine/Discovery/ReflectionTestDataCollector.cs works on System.Reflection.
Each is about 150 lines and mirrors the other branch for branch. The review rounds on #7343 found several parity gaps (nullable tuples, ITuple, reference-array spreads, and the netstandard2.0 ITuple gap fixed in e0738cb). Every new rule needs two edits.
Proposed work
Add a parity test that runs one table of (row type, method signature, expected type arguments or "infers nothing") cases through both implementations. Today Issue7214Tests checks parity only indirectly, through the test names.
Optionally, factor the shape classification (spread elements, whole row, unknown) into one place, so that each mode keeps only a thin mapping layer.
Acceptance criteria
One case table covers both modes and fails when they diverge.
Behaviour does not change. Compare inference results, including cases that infer nothing; runtime fallback behavior can intentionally differ between modes.
Cover the reviewed nullable-tuple, ITuple, reference-array spread, and netstandard2.0 tuple-shape cases.
The prerequisite #7343 is now on origin/main; this issue is available for implementation. This focused parity table is related to the broader rules consolidation in #7371 and should be reused there.
Triage update: #7343 has merged and #7214 is closed. Both inference implementations are now on origin/main; removed the completed prerequisite link. Issue7214Tests still checks integration outcomes rather than one direct inference case table. The body now makes that distinction explicit, including intentional runtime fallback differences.
PR #7620's latest Claude review asks that this parity table also cover sole-tuple reconstruction versus invariant whole-row matching. Please include nullable lifting, repeated generic bindings, generic interfaces/base classes, numeric and user-defined conversions, and string parsing for static value-tuple and instance reference-tuple sources. Its SingleTupleElementConversionTests, RepeatedTupleBindingTests and ClosedClassTupleInferenceTests provide shared execution fixtures in both modes; the follow-up here should compare inference directly, including rejected shapes.
PR #7620 is closed under its rework budget; tuple implementation and parity coverage continue in #7629. Preserve Claude review 6650151530's nonblocking follow-ups when designing this parity work: compare generic-base traversal and candidate-binding isolation in ReflectionTestDataCollector/TestGenericTypeResolver, consider a shared runtime helper and named matcher predicates, and document TupleHelper's cache key space (measure before changing the hot path). The repeated method-source attribute predicate and guarded failure lookup are cleanup suggestions, not acceptance blockers for #7628/#7629. The existing shared conversion matrix should remain the behavioral baseline.
Activity
thomhurst commentedon Nov 2, 2026
Triage update: #7343 has merged and #7214 is closed. Both inference implementations are now on
origin/main; removed the completed prerequisite link.Issue7214Testsstill checks integration outcomes rather than one direct inference case table. The body now makes that distinction explicit, including intentional runtime fallback differences.thomhurst commentedon Nov 5, 2026
PR #7620's latest Claude review asks that this parity table also cover sole-tuple reconstruction versus invariant whole-row matching. Please include nullable lifting, repeated generic bindings, generic interfaces/base classes, numeric and user-defined conversions, and string parsing for static value-tuple and instance reference-tuple sources. Its
SingleTupleElementConversionTests,RepeatedTupleBindingTestsandClosedClassTupleInferenceTestsprovide shared execution fixtures in both modes; the follow-up here should compare inference directly, including rejected shapes.thomhurst commentedon Nov 5, 2026
PR #7620 is closed under its rework budget; tuple implementation and parity coverage continue in #7629. Preserve Claude review 6650151530's nonblocking follow-ups when designing this parity work: compare generic-base traversal and candidate-binding isolation in ReflectionTestDataCollector/TestGenericTypeResolver, consider a shared runtime helper and named matcher predicates, and document TupleHelper's cache key space (measure before changing the hot path). The repeated method-source attribute predicate and guarded failure lookup are cleanup suggestions, not acceptance blockers for #7628/#7629. The existing shared conversion matrix should remain the behavioral baseline.