Skip to content

Updates for record structs - #4122

Merged
AArnott merged 8 commits into
masterfrom
record-struct
Oct 7, 2026
Merged

AArnott merged 8 commits into
masterfrom
record-struct

Conversation

@AArnott

@AArnott AArnott commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Closes #3979

Replaces #4074 by @sharwell. That PR can't be updated because it comes from a fork with maintainer edits turned off, and it has never run on the new GitHub Actions CI.

Sam's original commits are kept as-is:

  • b11d47ac2c SA1300 tests for record structs
  • f868720e7c SA1201 docs
  • ae5cb957c5 SA1204 tests
  • 73d9e96f29 SA1214 tests
  • 2fbedaab1e SA1642 docs
  • ac30b06e7e merge

On top of them:

  • Merge master (no conflicts)
  • Fix the SA1300 record struct test expectations:
    • SA1300 doesn't analyze constructors (the code fix renames them along with the type), so no diagnostic is expected on the explicit constructor.
    • Roslyn 4.0 (C# 10) reports the positional record struct name twice; later versions report it once. This follows the existing GetExpectedResultTestPositionalRecord1 pattern, with a C# 11 override.

sharwell and others added 8 commits December 6, 2025 11:01
SA1300 does not analyze constructors (the code fix renames them along with
the type), so no diagnostic is expected on the explicit constructor. The
positional record struct name is reported twice by Roslyn 4.0 (C# 10) and
once in later versions, matching the existing positional record test.
@AArnott
AArnott marked this pull request as ready for review October 7, 2026 20:05
@AArnott
AArnott merged commit 34768d6 into master Oct 7, 2026
21 checks passed
@AArnott
AArnott deleted the record-struct branch October 7, 2026 20:15
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.

Review impact of record structs on existing rules

2 participants