-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Constructor ordering, defaults, and overloads #63371
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
Constructor ordering, defaults, and overloads #63371
Conversation
Add a couple more params to the new record type
…ts (sort of) working
…r multiline comments
…ributes and structs
- Removed some extra spaces - Added generic and type constraint tests - Edited some comments for clarity - Added check for != operator content (+ tests) - Moved Resource strings to CSharp features resources - Reworked a default to make it null instead, then null check - Wrapped some long lines - Made sealed - Copied Base Type, still need tests
Just Clone and PrintMembers currently
Allow readonly props to move Changed equalization string Added Selection tests Removed Normalize whitespace Formatting fixes refactor no-body case add and clarify comments Some tests failing
| => (invocation.Instance == null || | ||
| IsSafeAssignment(invocation.Instance)) && | ||
| invocation.Arguments.All(arg => IsSafeAssignment(arg.Value)), | ||
| IUnaryOperation unary => IsSafeAssignment(unary.Operand), |
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.
Can we have a generic catch-all that just walks the child operations without having to special case all of these?
...CSharp/Portable/CodeRefactorings/ConvertToRecord/CSharpConvertToRecordRefactoringProvider.cs
Outdated
Show resolved
Hide resolved
...CSharp/Portable/CodeRefactorings/ConvertToRecord/CSharpConvertToRecordRefactoringProvider.cs
Outdated
Show resolved
Hide resolved
...CSharp/Portable/CodeRefactorings/ConvertToRecord/CSharpConvertToRecordRefactoringProvider.cs
Outdated
Show resolved
Hide resolved
...CSharp/Portable/CodeRefactorings/ConvertToRecord/CSharpConvertToRecordRefactoringProvider.cs
Outdated
Show resolved
Hide resolved
| private static bool IsSafeAssignment(IOperation operation) | ||
| => operation.WalkDownConversion() switch | ||
| { | ||
| if (operation is ILocalReferenceOperation) |
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.
We don't still need to check for IMemberReferenceOperation?
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.
Ah right, I forgot about the case where we access static members/methods. Any other member reference or invocation should have the instance and the member as ChildOperations so if a member reference of a local we should still hit it here.
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.
My main concern was whether a this reference counted as a local reference or as something else.
Extension of #63320
Completion list copied with new items bolded/italicized:
this(default, default...))