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 generic class type inference from untyped class data source rows that contain null values #7360
#7339 (#7210) added GenericClassRowPartition.InferClassTypeArguments (src/TUnit.Core/Attributes/TestData/GenericClassRowPartition.cs), the one rule both modes use to infer a generic test class's type arguments from an untyped class-level data source row. It handles null values specially:
With one type parameter, it skips leading null values and uses the first non-null value's run-time type. A row of only nulls infers nothing.
With several type parameters, a null among the leading values makes the row infer nothing.
The tests/TUnit.TestProject/Bugs/_7210 scenarios and the generator snapshots do not cover rows with null values. Claude's review of #7339 (comment 6565864008, item 5) raised this.
Expected
Add _7210-style scenarios, run in both modes by an Issue7210Tests-style engine test, for an untyped class source on a generic class that yields:
[null, 5] for Class<T>(T? a, int b): infers from the first non-null value, with the same tests in both modes.
A row of only nulls, which falls back like a row that infers nothing (AllRows / NoClassRow).
A two-parameter class with a null leading value.
Both modes should discover and run identical tests.
Audited against origin/maind87516c: GenericClassRowPartition.InferClassTypeArguments still has the documented null branches, and _7210/MixedClassSourceRowTests.cs does not cover these null rows. The requested coverage remains actionable.
Activity
thomhurst commentedon Nov 3, 2026
Audited against
origin/maind87516c:GenericClassRowPartition.InferClassTypeArgumentsstill has the documented null branches, and_7210/MixedClassSourceRowTests.csdoes not cover these null rows. The requested coverage remains actionable.Strengthen null-row regression coverage and update snapshot (#7360)
Cover null rows in generic class type inference (#7621)