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
Nullable-event regression tests use unsupported warning-error pragmas #7432
The nullable-event regression tests use five unsupported C# directives, #pragma warning error CS8604 through CS8615. The compiler emits CS1634 instead of promoting those diagnostics to errors, so the intended compile-time protection is ineffective.
Reproduction
Run dotnet test --project tests/TUnit.Mocks.Tests --framework net10.0 --treenode-filter "/*/*/Issue5425Tests/*" with SDK 10.0.403. tests/TUnit.Mocks.Tests/Issue5425Tests.cs:13-17 produces CS1634 (expected disable or restore).
Expected and actual
The file comments promise that nullable-event signature regressions fail compilation. These pragmas do not enforce that promise. Replace them with supported diagnostic severity configuration and verify it applies to the generated code that produces the targeted warnings.
Environment
.NET SDK 10.0.403, macOS arm64, PR #7405 head 68112ca.
Superseded by PR #7414 and #7436. Verified #7414 at e3544bce4d609e07ad249d911087dda9b0511dbc: it removes all five unsupported pragmas from Issue5425Tests.cs and promotes those diagnostics in the project file. The remaining requirement to enforce diagnostics inside generated code is now explicit in #7436, including a positive control. Closing this duplicate tracking item; the generated-code guard remains open in #7436.
Activity
thomhurst commentedon Nov 3, 2026
Superseded by PR #7414 and #7436. Verified #7414 at
e3544bce4d609e07ad249d911087dda9b0511dbc: it removes all five unsupported pragmas fromIssue5425Tests.csand promotes those diagnostics in the project file. The remaining requirement to enforce diagnostics inside generated code is now explicit in #7436, including a positive control. Closing this duplicate tracking item; the generated-code guard remains open in #7436.