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
Infer generic class types from class MethodDataSource rows using shared runtime support #7446
A generic test class whose only type information comes from a class-level MethodDataSource silently disappears in generated discovery. Enable declared-row and constructor-based type inference once the sibling runtime support is merged, so both discovery modes run the same tests or report an actionable discovery failure.
Scope and owned files
src/TUnit.Core.SourceGenerator/Generators/TestMetadataGenerator.cs and src/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/InstanceFactoryGenerator.cs.
tests/TUnit.Core.SourceGenerator.Tests/Bugs/7333/Tests7333.cs, affected generator snapshots, tests/TUnit.TestProject/Bugs/_7333/ClassMethodDataSourceInferenceTests.cs, _7161/ClassDataForMethodRowInstantiationTests.cs, and tests/TUnit.Engine.Tests/Issue7333Tests.cs / Issue7208Tests.cs. Reconcile runtime regressions introduced by the prerequisite rather than duplicating them.
Reuse preserved branch issue-7333-class-method-source, head df168fa58f32f0ef591b731330cf2407b4922fc9.
Run full generator snapshot tests and targeted fixtures in both modes, review verified snapshots, run PublicAPI checks where applicable, and publish/execute Native AOT fixtures. Leave Engine.Tests to CI.
Split because #7422 reached 21 automated review rounds with a new blocking parity finding. Parent #7333 remains open until both parts deliver its acceptance criteria.
Triaged against origin/main at 87d2a30. The inference changes and ConfigureInferredSource runtime support from closed, unmerged #7422 are still absent. Both sibling issues remain necessary; #7425 covers diagnostics but does not deliver class-source inference. Removed the redundant blocked label; the native blocked_by dependency on #7445 remains authoritative.
Additional row-partition parity case found while fixing #7518's method-provider retention. A declared interface constructor source plus a concrete method source produces an extra inferred class test in generated discovery. Reflection only runs the explicitly requested interface instantiation.
SDK 10.0.403, net10.0, macOS arm64. At #7518 head 4a5e436, generated discovery emits C (passing) and C (missing method arguments); reflection emits only the passing C. The provider-retention fix repairs C, but the extra generated C remains. The same difference occurs with a DataSourceGeneratorAttribute method provider. Expected: both modes run the same closed instantiations.
Reproduce with the ExplicitCompatibleMethodRows and ExplicitCompatibleTypedMethodRows fixtures added to tests/TUnit.TestProject/Bugs/_7490/Tests.cs in #7518: run net10.0 with --treenode-filter '//TUnit.TestProject.Bugs._7490/ExplicitCompatibleMethodRows/*', then add --reflection. Please cover these declared-source/explicit-type combinations in this issue's class-source inference and partition work.
Activity
thomhurst commentedon Nov 3, 2026
Triaged against origin/main at 87d2a30. The inference changes and ConfigureInferredSource runtime support from closed, unmerged #7422 are still absent. Both sibling issues remain necessary; #7425 covers diagnostics but does not deliver class-source inference. Removed the redundant blocked label; the native blocked_by dependency on #7445 remains authoritative.
thomhurst commentedon Nov 4, 2026
Additional row-partition parity case found while fixing #7518's method-provider retention. A declared interface constructor source plus a concrete method source produces an extra inferred class test in generated discovery. Reflection only runs the explicitly requested interface instantiation.
SDK 10.0.403, net10.0, macOS arm64. At #7518 head 4a5e436, generated discovery emits C (passing) and C (missing method arguments); reflection emits only the passing C. The provider-retention fix repairs C, but the extra generated C remains. The same difference occurs with a DataSourceGeneratorAttribute method provider. Expected: both modes run the same closed instantiations.
Reproduce with the ExplicitCompatibleMethodRows and ExplicitCompatibleTypedMethodRows fixtures added to tests/TUnit.TestProject/Bugs/_7490/Tests.cs in #7518: run net10.0 with --treenode-filter '//TUnit.TestProject.Bugs._7490/ExplicitCompatibleMethodRows/*', then add --reflection. Please cover these declared-source/explicit-type combinations in this issue's class-source inference and partition work.