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 generator: GenerateGenericTestWithConcreteTypes and its GenerateConcreteTestMetadata chain are unreferenced dead code #7194
In src/TUnit.Core.SourceGenerator/Generators/TestMetadataGenerator.cs, GenerateGenericTestWithConcreteTypes (line 5757 on main at d43977c) has no callers. Only its own declaration matches grep -c GenerateGenericTestWithConcreteTypes. It is the only caller of GenerateConcreteTestMetadata (line 7953), and that in turn is the only caller of GenerateConcreteMetadataWithFilteredDataSources (line 8185). Together they are several hundred lines.
That chain duplicates the logic of the live concrete-instantiation path (CollectConcreteInstantiations / EmitConcreteInstanceCreation / EmitConcreteDataSources), including the data-source filtering for [Arguments] rows. Generic-row fixes such as #7106, #7118 and #7161 change only the live path. So the dead copy now encodes outdated semantics and misleads readers who search for where class data sources are chosen.
Reproduce:grep -n "GenerateGenericTestWithConcreteTypes\|GenerateConcreteTestMetadata(\|GenerateConcreteMetadataWithFilteredDataSources(" src/TUnit.Core.SourceGenerator/Generators/TestMetadataGenerator.cs. Each method is referenced only by its declaration or by the dead method above it.
Expected: remove the unreferenced chain. Generator snapshot output should not change.
Hi, I'd be interested in contributing a fix for this.
My understanding is that the goal is to remove the unreferenced GenerateGenericTestWithConcreteTypes chain and verify that the source generator's output remains unchanged.
Before proceeding, I'll check the current main branch and the changes introduced by #7192 to make sure this cleanup is still needed and doesn't overlap with recent changes.
Activity
Saad-elnagar commentedon Oct 20, 2026
Hi, I'd be interested in contributing a fix for this.
My understanding is that the goal is to remove the unreferenced
GenerateGenericTestWithConcreteTypeschain and verify that the source generator's output remains unchanged.Before proceeding, I'll check the current
mainbranch and the changes introduced by #7192 to make sure this cleanup is still needed and doesn't overlap with recent changes.Thanks for documenting this!
Correct generic metadata summary after dead code removal (#7194)
Remove unused concrete metadata generation chain (#7194)
Correct generic metadata summary after dead code removal (#7194)
Remove unused concrete metadata generation chain (#7194)
Remove unused concrete metadata generation chain (#7194)
Remove unused concrete metadata generation chain (#7194)
Refresh STA generator snapshot after #7594 for #7194
Refresh remaining STA generator snapshots after #7594 (#7194)
Remove unused concrete metadata generation chain (#7194)
Remove unused concrete metadata generation chain (#7194)
Remove unused concrete metadata generation chain (#7194) (#7569)