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
DiagnosticCatalog silently hands out duplicate diagnostic IDs when a number is reused #20
DiagnosticCatalog.Add (SourceGeneratorToolkit/DiagnosticCatalog.cs:~56-68) formats {prefix}{number:000} without checking whether that number is already in use.
Priority: Medium. Two diagnostics under one ID break .editorconfig severity overrides and #pragma suppressions without any error. It only happens when a generator author reuses a number by mistake, and the fix is small and local.
Area / suggested assignee:DiagnosticCatalog.Add in SourceGeneratorToolkit/DiagnosticCatalog.cs. Maintainer: @matt-edmondson.
Next steps: Keep a HashSet<int> of the numbers already used and throw ArgumentException when one is reused. Add a test that registers the same number twice through Warning and Error and expects the throw.
Activity
matt-edmondson commentedon Sep 26, 2026
Triage
.editorconfigseverity overrides and#pragmasuppressions without any error. It only happens when a generator author reuses a number by mistake, and the fix is small and local.DiagnosticCatalog.AddinSourceGeneratorToolkit/DiagnosticCatalog.cs. Maintainer: @matt-edmondson.HashSet<int>of the numbers already used and throwArgumentExceptionwhen one is reused. Add a test that registers the same number twice throughWarningandErrorand expects the throw.Generated by Claude Code