fix(analyzers): ignore partial type parts for RCS1060 - #1798
Merged
Conversation
Skip additional partial declarations of the same type when counting types in a compilation unit so interface-only partial parts do not trigger declare-each-type-in-separate-file diagnostics. Fixes #1779 Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
josefpihrt
commented
Aug 11, 2026
josefpihrt
left a comment
Collaborator
Author
There was a problem hiding this comment.
Review notes for the RCS1060 partial-type fix. The approach matches #1779 well (count distinct types, not every partial part), with one correctness gap around generic arity.
Partial types with the same name but different type-parameter counts are distinct types and should still trigger DeclareEachTypeInSeparateFile. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…stinct type Most namespaces never collide on name+arity; skip extra partial parts of the first type without a HashSet. Co-authored-by: Cursor <cursoragent@cursor.com>
Satisfy RCS1050 in the lazy type-key set initializer. Co-authored-by: Cursor <cursoragent@cursor.com>
Skip the diagnostic only when a file (or its single namespace) contains nothing but multiple partial declarations of one type, leaving the existing type-counting loop untouched. Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Aug 16, 2026
Open
This was referenced Aug 20, 2026
Open
Open
Open
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
partialdeclarations of an already-seen type so multiple partial parts of the same type do not trigger RCS1060.Fixes #1779
Test plan
dotnet test src/Tests/Analyzers.Tests --filter FullyQualifiedName~RCS1060Made with Cursor