Skip to content

Conversation

@TimothyMakkison
Copy link
Contributor

Repeat of #4575 without the git issues

@TimothyMakkison TimothyMakkison marked this pull request as draft January 27, 2026 13:06
@TimothyMakkison TimothyMakkison marked this pull request as ready for review January 27, 2026 13:10
@TimothyMakkison TimothyMakkison force-pushed the source_gen_cleanup branch 2 times, most recently from d3fbdd8 to 6688e58 Compare January 27, 2026 13:18
@thomhurst
Copy link
Owner

Summary

Removes unused types and methods from TUnit.Core.SourceGenerator.

Critical Issues

None found ✅

All removed code is verified unused:

  • Model files: DiagnosticContext, PropertyDataModel, GenericTestRegistration, PropertyInjectionContext, StaticClassDataSourceInjectorModel, TestDefinitionContext, TestHookCollectionDataModel, TypeWithDataSourceProperties - all only referenced in their own definitions
  • Methods in TestMetadataGenerator.cs:
    • GenerateSpecificGenericInstantiation - never called
    • GenerateAotFriendlyInvokers - never called
    • ProcessGenerateGenericTestAttribute - never called
    • IsAsyncMethod - duplicate, TestMethodAnalyzer has its own implementation
    • ReturnsValueTask - never called
    • GetDefaultValueString - never called
    • IsGenericTypeParameter - never called
    • ValidateTypeConstraints(INamedTypeSymbol, ...) - overload never called (IMethodSymbol overload is still used)
  • Parameter: combinationGuid in GenerateGenericTestWithConcreteTypes - never used in method body

TUnit Rules Check

✅ No dual-mode changes (source-gen/reflection)
✅ No source generator output changes (internal cleanup only)
✅ No public API changes
✅ No snapshot test updates needed
✅ No performance impact
✅ No VSTest usage

Verdict

APPROVE - Clean removal of dead code with no functional impact

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants