-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Initial support for compound assignment expression utilizing extension operators #78908
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
Initial support for compound assignment expression utilizing extension operators #78908
Conversation
|
|
||
| foreach (var scope in new ExtensionScopes(this)) | ||
| { | ||
| extensionDeclarationsInSingleScope.Clear(); |
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.
I'd missed in previous PRs: just to confirm, we don't need to clear result too? #Resolved
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.
I'd missed in previous PRs: just to confirm, we don't need to clear
resulttoo?
BinaryOperatorExtensionOverloadResolutionInSingleScope clears it before repopulating.
jcouv
left a comment
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 (commit 2)
| static void Main() | ||
| { | ||
| var s1 = new S1(); | ||
| s1 += s1; |
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.
Consider adding a test verifying IL so it can be seen what this lowers to. #Resolved
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.
Consider adding a test verifying IL so it can be seen what this lowers to.
I put the lowest priority on testing IL. There is nothing tricky about it apart from switching to implementation method. So, I think that IL verification, plus observing runtime behavior is sufficiently good. In addition at the bottom of this file there is a PROTOTYPE comment to increase coverage for runtime behavior.
I'll take care of this later. In reply to: 2964115516 Refers to: src/Compilers/CSharp/Test/Emit3/Semantics/ExtensionOperatorsTests.cs:16198 in 7d3d14c. [](commit_id = 7d3d14c, deletion_comment = False) |
Relates to test plan #76130