Skip to content

[Version 10.0] Feature support for record structs#1556

Draft
RexJaeschke wants to merge 11 commits into
draft-10from
v10-record-structs
Draft

[Version 10.0] Feature support for record structs#1556
RexJaeschke wants to merge 11 commits into
draft-10from
v10-record-structs

Conversation

@RexJaeschke

@RexJaeschke RexJaeschke commented Jan 28, 2026

Copy link
Copy Markdown
Contributor

The original version of this PR has been modified based on Issue #1683.

This is Rex's adaptation of the corresponding MS proposal.

@RexJaeschke RexJaeschke added this to the C# 10 milestone Jan 28, 2026
@RexJaeschke RexJaeschke added type: feature This issue describes a new feature Review: pending Proposal is available for review labels Jan 28, 2026
@RexJaeschke
RexJaeschke marked this pull request as draft January 28, 2026 16:41
Comment thread standard/structs.md
;

record_struct_body
: struct_body ';'?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The optional trailing semicolon was not mentioned in the MS proposal; however, I discovered that VS 2026 18.2.1 allows it (just as we allow it for record classes). What was the intent here?

RexJaeschke and others added 10 commits June 24, 2026 14:58
Remove unnecessary blank lines from classes.md
- Grammar allows `record` and `record class`
- `with` expressions allowed in non-record struct types
- a couple small merge issues where text was lost
@BillWagner
BillWagner force-pushed the v10-record-structs branch from 9f994ae to 36f3bcf Compare June 24, 2026 18:58
@BillWagner

Copy link
Copy Markdown
Member

An earlier version of this feature is already present on alpha-v10 from a prior meeting. Edits made to this PR since then are not yet on alpha-v10; they will land at the next propagation. If you need them on alpha-v10 sooner, please open a separate PR targeting alpha-v10.
Thanks!

@RexJaeschke

Copy link
Copy Markdown
Contributor Author

After researching and writing-up "Primary constructors" as a general feature in v12 for classes and structs outside of record variants, I have made a lot of tweaks to this spec (and to the V9 record class spec) to ease the transition to that v12 spec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review: pending Proposal is available for review type: feature This issue describes a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants