Skip to content

Accept compatible generic array elements inside tuple data-source parameters #7539

Closed

Description

@thomhurst

Implement the tuple/open-array recursion requested in #7489 so compatible method data source rows compile without TUnit0001. Keep this change small and conservative when generic compatibility cannot be proven.

Scope and acceptance criteria

Own src/TUnit.Analyzers/Extensions/CompilationExtensions.cs and focused tuple-array analyzer tests. Reuse the tuple/array shape traversal and headline regressions from branch issue-7489-tuple-array (head d17bbe7), without importing its full bound-inference engine. Accept (Fixture, CancellationToken, int[]) against (Fixture, CancellationToken, T[]); cover nested tuples, jagged arrays, rank/SZ-array mismatches and concrete incompatible elements. Use Roslyn conversions for decidable concrete cases and conservatively accept uncertain open generic compatibility. Run relevant analyzer tests.

PR #7517 exceeded its review budget. Its latest blocking finding concerns impossible System.Array/interface upper bounds in the optional precision engine; this structural part must avoid introducing that engine. Keep existing concrete diagnostics and valid variance conversions covered. Generic constraints remain in #7520.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium: edge case, mode divergence, flaky test, or workaround existsbugSomething isn't workingin-progressWork is in progress

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions