Skip to content

fix(analyzers): fix RCS0034 for primary constructor types - #1791

Merged
josefpihrt merged 2 commits into
mainfrom
fix/analyzers/rcs0034-primary-constructor
Aug 8, 2026
Merged

fix(analyzers): fix RCS0034 for primary constructor types#1791
josefpihrt merged 2 commits into
mainfrom
fix/analyzers/rcs0034-primary-constructor

Conversation

@josefpihrt

Copy link
Copy Markdown
Collaborator

Summary

  • RCS0034 no longer reports a false positive when a type has a primary constructor and multiple where clauses on separate lines
  • Anchor constraint trivia on the primary constructor closing parenthesis instead of the type parameter list

Fixes #1761

Test plan

  • dotnet test src/Tests/Formatting.Analyzers.Tests/Formatting.Analyzers.Tests.csproj --filter FullyQualifiedName~RCS0034PutTypeParameterConstraintOnItsOwnLineTests

Made with Cursor

Anchor constraint clause trivia on the primary constructor closing
parenthesis instead of the type parameter list when present.

Fixes #1761

Co-authored-by: Cursor <cursoragent@cursor.com>
josefpihrt added a commit that referenced this pull request Aug 8, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread ChangeLog.md Outdated
@josefpihrt
josefpihrt merged commit 9445060 into main Aug 8, 2026
17 checks passed
@josefpihrt
josefpihrt deleted the fix/analyzers/rcs0034-primary-constructor branch August 8, 2026 19:47
josefpihrt added a commit that referenced this pull request Aug 14, 2026
Covers primary constructor with multiple type constraints on separate
lines. Behavior was fixed in #1791; this locks the reported scenario.

Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Aug 16, 2026
This was referenced Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RCS0034 incorrectly merges first 'where' clause onto declaration line for generic type with primary constructor and multiple type parameters

1 participant