-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Test plan for "record structs" #51199
Comments
Have the implementation of the feature started? |
It's about to |
Posting few things that are easy to forget: [jcouv: thanks for the scenarios. I moved them into OP] |
PR #52261 added the coverage and fixes suggested by @Youssef1313. Thanks! |
One more minor scenario: |
Moved to OP. |
@jcouv |
@Youssef1313 MakeTypeAbstract is "done" because a test was added, but purposefully not supporting because structs can't be abstract. |
@Youssef1313 Added. Thanks |
Remaining issues are tracked as separate issues (linked). I'll go ahead and close this. |
Championed issue: dotnet/csharplang#4334
Spec: https://github.com/dotnet/csharplang/blob/master/proposals/csharp-10.0/record-structs.md
Relates to parameterless ctor and field initializers in structs: dotnet/csharplang#99
Compiler
TypeDeclaration_IsStruct_InConstraints
,TypeDeclaration_IsStruct_Unmanaged
)TypeDeclaration_IsStruct
)Clone_DisallowedInSource
)RestrictedTypesAndPointerTypes
)TypeDeclaration_NoDestructor
)Equals
for this type (seeEquality_xy
)Equals
forobject
type (seeEquality_01
andObjectEquals_06
for user-defined)GetHashCode
(seeRecordEquals_xy
,GetHashCode_UserDefined
==
and!=
operators for this type (seeEqualityOperators_xy
)PrintMembers
ToString
RecordProperties_01_EmptyParameterList
,TypeDeclaration_NoParameterlessConstructor
,TypeDeclaration_NoInstanceInitializers
)RecordProperties_02
)this
constructor initializer. (seeRecordProperties_02
)RecordProperties_03
)XmlDoc
)get
andinit
auto-property is created if the record struct hasreadonly
modifier,get
andset
otherwise. (seeRecordProperties_01_Readonly
)RecordProperties_01
)AttributesOnPrimaryConstructorParameters_01
)with
expression on structsWork items
struct Point(int x, int y);
record interface C(int X, int Y);
(RecordInterfaceParsing
)readonly
(conditionally) (answer: yes, issue Record structs: emitreadonly
modifier for synthesized members #54419)left
andright
parameter names in equality/inequality operators (PR Merge latest bits from main into record-structs #52236)with
on structs (PR Allow 'with' expression on value types #52319)with
expressions on anonymous types (PR Allowwith
on anonymous types #53248)IsRecord
(tracking issue ImplementIsRecord
on record structs #52233, PR Record-structs: Address some PROTOTYPE markers #52256)ISpanFormattable
? (answer: no)ToString
/PrintMembers
useInterpolatedStringBuilder
? (discussion) (answer: no)Equals(R)
API doesn't needin
(answer: we won't addin
overloads, too heuristic-dependant)with
on generic structs (did we have LDM notes and/or decision already? current behavior is fine )GetHashCode
should include a hash of the type (this isn't needed per email thread, current behavior is fine)Productivity
PrintMembers
isn't reported as unused by IDE analyzers. See PrintMembers method in record is unused #52421The text was updated successfully, but these errors were encountered: