dotnet / dotnet/csharplang

Proposal: record structs

Open
#4,334 4 comments 71 reactions 1 assignee Claimed by @jcouv View on GitHub
Implemented Needs ECMA Spec Proposal Proposal champion
Dominant language
C#
Stars
12.7k
Forks
1.1k
Avg merge
11h 1m
Merged PRs (30d)
3

Description

- [x] Proposal added: https://github.com/dotnet/csharplang/blob/main/proposals/csharp-10.0/record-structs.md
- [x] Discussed in LDM
- [x] Decision in LDM
- [x] Finalized: Done
- [ ] Spec'ed

Allow value type records with `record struct`.

Secondarily, we would also allow `record class` (with same meaning as `record`) and allow explicit declarations of positional members using different member kinds (`get/set` property, or field).

# References
- https://github.com/dotnet/csharplang/blob/master/proposals/csharp-9.0/records.md
- https://github.com/dotnet/csharplang/blob/master/spec/structs.md
- https://github.com/dotnet/csharplang/blob/master/meetings/2020/LDM-2020-05-04.md#structs-as-records
- https://github.com/dotnet/csharplang/blob/master/meetings/2020/LDM-2020-06-22.md#struct-records
- https://github.com/dotnet/csharplang/blob/master/meetings/2020/LDM-2020-09-30.md#struct-equality
- https://github.com/dotnet/csharplang/blob/master/meetings/2020/LDM-2020-10-05.md#record-struct-primary-constructor-defaults
https://github.com/dotnet/csharplang/blob/master/meetings/2020/LDM-2020-10-07.md#record-struct-syntax

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.