Skip to content

refactor: simplify tuple handling with #if for newer TFMs#4790

Merged
thomhurst merged 1 commit intomainfrom
refactor/simplify-tuple-handling
Feb 14, 2026
Merged

refactor: simplify tuple handling with #if for newer TFMs#4790
thomhurst merged 1 commit intomainfrom
refactor/simplify-tuple-handling

Conversation

@thomhurst
Copy link
Owner

Summary

  • Use ITuple interface on net8.0+ to replace arity-specific tuple overloads, keeping them only on netstandard2.0 via #else
  • Replace duplicate IsTupleType(Type) methods in DataUnwrapper and DataSourceHelpers with existing TupleHelper.IsTupleType(Type)
  • Gate unused generic UnwrapTuple overloads in DataSourceHelpers to netstandard2.0 only

Test plan

  • Build succeeds on all 4 TFMs (netstandard2.0, net8.0, net9.0, net10.0)
  • Public API snapshot tests pass on all 4 TFMs (net472, net8.0, net9.0, net10.0)
  • Net4_7 snapshot unchanged (netstandard2.0 API preserved)
  • CI passes

🤖 Generated with Claude Code

Use ITuple interface on net8.0+ to replace arity-specific overloads:
- DataConversionHelper: single ITuple-based UnwrapTuple and ConvertAsyncEnumerableTupleToObjectArrays
- TupleExtensions: single ITuple-based ToObjectArray replacing 7 overloads
- DataSourceHelpers: gate 7 unused generic UnwrapTuple overloads, remove duplicate IsTupleType
- DataUnwrapper: remove duplicate IsTupleType, use TupleHelper.IsTupleType

All arity-specific overloads preserved on netstandard2.0 via #else.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@claude
Copy link
Contributor

claude bot commented Feb 14, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

This is a clean refactoring that properly leverages the ITuple interface on modern frameworks while maintaining backward compatibility. The conditional compilation structure is correct, snapshot tests have been updated appropriately, and the changes align with TUnit's performance-first principles by reducing code duplication without sacrificing functionality.

@thomhurst thomhurst merged commit 55d6ee6 into main Feb 14, 2026
12 of 14 checks passed
@thomhurst thomhurst deleted the refactor/simplify-tuple-handling branch February 14, 2026 15:29
This was referenced Feb 14, 2026
This was referenced Feb 16, 2026
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.

1 participant