-
Notifications
You must be signed in to change notification settings - Fork 1.8k
C#: Support for record structs #7605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@tamasvajk @hvitved This is the initial suggestion for record struct support. I am not sure,
|
I don't think we should delete |
Great - thank you! 😄 |
b7ad1a2
to
608d2fc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approach looks good to me.
…lied to both class and struct).
…ment support for record struct types.
…w summary support for record struct constructors.
a2fa6ad
to
b927aad
Compare
In this PR we make support for record structs and change the original implementation for
record
.Characteristics of the old implementation
record
.It appears that there is nothing in IL level that identifies, whether something is a record type (it seems native to C# only).
In C# 10, it is now also possible to declare a
record struct
andrecord class
.record class
is clarification ofrecord
(that isrecord
is just a shorthand forrecord class
). That isrecord
implicitly meansrecord class
and as such, we can consider therecord
keyword to be a modifier that applies toclass
andstruct
.