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
Source-gen drops an [Arguments<T>] row on a generic test method when another row infers the same types; reflection runs it #7214
On a generic test method, a typed data source such as [Arguments<int>(2)] that infers the same method type arguments as another row is dropped in source-generated mode. Reflection mode runs it.
source-gen: 1 test, Run<int>(1). The [Arguments<int>(2)] row never runs.
--reflection: 2 tests, Run<int>(1) and Run<int>(2).
On PR #7186 (fix/issue-7164-typed-source-generic-class), the same method on a generic class ([GenerateGenericTest(typeof(string))] class C<TClass>) gives the same split: 1 test in source-gen, 2 in reflection. On main that generic-class shape does not compile in source-gen (#7117).
Where (not yet traced)
The likely place is the source generator's per-method instantiation/row collection (TestMetadataGenerator.CollectConcreteInstantiations and the typed-source inference around InferTypesFromDataSourceAttribute). Note that ArgumentsAttribute<T> has the symbol Name"ArgumentsAttribute", the same as the non-generic [Arguments], which many generator checks compare against by name. Reflection mode tells them apart (is ArgumentsAttribute), so the two modes may classify this attribute differently.
Expected
Both modes run the same rows: here, 2 tests (Run<int>(1) and Run<int>(2)), as reflection mode does.
Activity