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 silently drops a generic test method when its type arguments cannot be inferred from the data source #7163
In source-generated mode, a generic test method whose type arguments cannot be inferred at compile time is dropped silently. No test is registered and no diagnostic is reported. Reflection mode still discovers and runs the test, so the two modes disagree on the test count without any hint. Typical inputs:
A single-value row feeding Test<T1, T2>(T1 a, T2 b), where T2 cannot be inferred from the row.
PR #7143 widened the row shapes source-gen can infer from, but these cases still fall through InferTypesFromMethodDataSource (src/TUnit.Core.SourceGenerator/Generators/TestMetadataGenerator.cs), which returns null, and no entry is emitted.
dotnet run shows no test. dotnet run -- --reflection shows Generic<int>.
Expected
The issue author asked for one of two things, and this tracks that remaining part of #7108. Either source-gen reports a diagnostic, for example "cannot infer type arguments for generic test X from data source Y; add [GenerateGenericTest] or type the data source", or it emits a placeholder that fails at runtime with that message. Either way, the test must not vanish silently.
Activity
fix(sourcegen): keep dropping duplicate-inferring sources on [Generat…
fix(sourcegen): report generic test rows whose type arguments cannot …
fix(sourcegen): split object-typed fields by runtime value; skip infe…
fix(sourcegen): infer generic method types from any MethodDataSource …