Skip to content

fix(analyzers): skip RCS1231 for ref struct parameters - #1807

Merged
josefpihrt merged 4 commits into
mainfrom
fix/analyzers/rcs1231-ref-struct
Aug 14, 2026
Merged

fix(analyzers): skip RCS1231 for ref struct parameters#1807
josefpihrt merged 4 commits into
mainfrom
fix/analyzers/rcs1231-ref-struct

Conversation

@josefpihrt

Copy link
Copy Markdown
Collaborator

Summary

  • Skip RCS1231 (Make parameter ref read-only) for ref struct parameters; suggesting in can break returning the parameter by value.

Fixes #1725

Test plan

  • dotnet test src/Tests/Analyzers.Tests --filter FullyQualifiedName~RCS1231

Made with Cursor

josefpihrt and others added 2 commits August 9, 2026 18:01
Making ref struct parameters `in` can break returning them by value.
Fixes #1725.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

@josefpihrt josefpihrt left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review notes for skipping RCS1231 on ref struct parameters. Clean fix for #1725.

Comment thread src/Analyzers/CSharp/Analysis/RefReadOnlyParameterAnalyzer.cs
@josefpihrt
josefpihrt merged commit 4558aeb into main Aug 14, 2026
2 checks passed
@josefpihrt
josefpihrt deleted the fix/analyzers/rcs1231-ref-struct branch August 14, 2026 20:08
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.

[RCS1231] On ref struct

1 participant