-
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
Only record class can have a copy constructor. #68442
Conversation
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.
LGTM Thanks (iteration 1)
@@ -115,7 +115,7 @@ internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, r | |||
|
|||
internal static bool IsCopyConstructor(Symbol member) | |||
{ | |||
if (member is MethodSymbol { ContainingType.IsRecordStruct: false, MethodKind: MethodKind.Constructor } method) |
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.
On second thought, isn't this change affecting the behavior for a copy constructor in a record struct? Looking at the spec, there is no notion of copy constructor in record structs.
Never mind, IsRecord
really means IsRecordClass
. #Closed
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
2 |
Fixes #68345.
Relates to #65697