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 generators reuse diagnostic IDs for unrelated rules #7504
Source generators assign the same diagnostic IDs to unrelated errors. Suppressing or configuring one rule can therefore affect another rule, and users cannot reliably identify the failure from its ID. Generator IDs should identify a single rule across the packages.
Reproduction
On current main, compare src/TUnit.Core.SourceGenerator/Generators/AotConverterGenerator.cs (lines 73 and 543) with src/TUnit.Assertions.SourceGenerator/Generators/MethodAssertionGenerator.cs (lines 26 and 35). Both declare TUNITGEN001 and TUNITGEN002 for different rules.
Expected and actual
Expected: each generator rule has a unique, documented ID. Actual: IDs collide across the core and assertions generators; there is no shared registry preventing reuse. PR #7503 adds a distinct TUNITGEN005 and surfaced this existing issue during review.
Environment
Repository main at 9d6a435. Please establish unique generator diagnostic IDs with a shared registry or validation and document their meanings.
Activity
Fix registry test source lookup in deterministic builds (#7504)
Fix generator diagnostic ID collisions and add shared registry (#7504)
Fix registry test source lookup in deterministic builds (#7504)
Fix colliding generator diagnostic IDs (#7538)