When [assembly: TUnit.Mocks.GenerateMock(typeof(T))] is applied to a large interface, the source generator produces no output and emits no diagnostic. The attribute line itself compiles (proving the type is accessible), but the generated TMockable type simply does not exist, causing CS0246 at every usage site with no indication of what went wrong.
To reproduce
- Add GenerateMock for a large SDK-generated interface — e.g. one with 100+ method overloads
- The attribute compiles without error
- Reference TMockable anywhere in the project
- Build → CS0246: The type or namespace name 'TMockable' could not be found
Switching to a smaller interface (e.g. one with ~30 methods) works correctly with identical setup.
Expected behavior
Either the mock is generated, or a diagnostic is emitted explaining why generation failed:
▎ TUnit.Mocks: failed to generate mock for 'T'. [reason]
Actual behavior
No generated type. No warning. No error from the generator. Only a CS0246 at the call site with no pointer to the root cause.
Additional context
The failure appears to be interface-size-dependent. The generator likely hits an internal limit or encounters an unhandled exception on a specific method signature and swallows it. A diagnostic on failure would make this immediately debuggable.
When [assembly: TUnit.Mocks.GenerateMock(typeof(T))] is applied to a large interface, the source generator produces no output and emits no diagnostic. The attribute line itself compiles (proving the type is accessible), but the generated TMockable type simply does not exist, causing CS0246 at every usage site with no indication of what went wrong.
To reproduce
Switching to a smaller interface (e.g. one with ~30 methods) works correctly with identical setup.
Expected behavior
Either the mock is generated, or a diagnostic is emitted explaining why generation failed:
▎ TUnit.Mocks: failed to generate mock for 'T'. [reason]
Actual behavior
No generated type. No warning. No error from the generator. Only a CS0246 at the call site with no pointer to the root cause.
Additional context
The failure appears to be interface-size-dependent. The generator likely hits an internal limit or encounters an unhandled exception on a specific method signature and swallows it. A diagnostic on failure would make this immediately debuggable.