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
Generic class with an empty typed class MethodDataSource gets an extra instantiation in source-generated mode only #7899
P2Medium: edge case, mode divergence, flaky test, or workaround existsbugSomething isn't workingneeds-humanRequires an owner decision or action before automated work continues
A generic test class whose class-level [MethodDataSource] is typed as IEnumerable<string> but returns no rows, and whose test method is closed by [Arguments(1)], discovers two tests in source-generated mode but one in reflection mode. Source-generated mode adds a second instantiation, C<string>, from the declared element type of the empty class source, and runs Empty on it with no method arguments. Both modes should discover the same tests.
Run with --treenode-filter "/*/*/C*/*", then repeat with --reflection.
Expected and actual
Expected: both modes discover the same instantiations and the same number of tests.
Actual: source-generated mode discovers 2 tests (Empty(1) on C<int>, and Empty with no arguments on C<string>); reflection mode discovers 1 (Empty(1) on C<int>).
Environment
main at 163db63, .NET SDK 10.0.403, net10.0, macOS arm64.
Seen while validating #7442. Which instantiation set is intended here, so both modes can be aligned to it?
P2Medium: edge case, mode divergence, flaky test, or workaround existsbugSomething isn't workingneeds-humanRequires an owner decision or action before automated work continues
Activity
test(generic): #7899 empty declared class source adds no instantiation
fix(generic): infer generic class types from member, typed and type-f…