- Notifications
You must be signed in to change notification settings - Fork4.2k
Support NotNullIfNotNull in user-defined binary operators#48490
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| (c1 / c2).ToString(); // no warn | ||
| (c1 / cn2).ToString(); // warn | ||
| (cn1 / c2).ToString(); // no warn | ||
| (cn1 / cn2).ToString(); // warn |
RikkiGibsonOct 12, 2020 • edited by jcouv
Loading Uh oh!
There was an error while loading.Please reload this page.
edited by jcouv
Uh oh!
There was an error while loading.Please reload this page.
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.
Could you please add a test that verifies expected behavior around+=/-=/*=//= with these operators? Both the nullable state of the expression and the nullable state of the LHS of the assignment.
#Closed
duracellkoOct 13, 2020 • edited by jcouv
Loading Uh oh!
There was an error while loading.Please reload this page.
edited by jcouv
Uh oh!
There was an error while loading.Please reload this page.
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.
Test added. Let me know, if you still find some missing coverage. #Closed
RikkiGibson left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
PR looks good to me, thanks, would just like to have a small bit of additional testing. We should think about what other nullability attributes could be applicable to user-defined binary operators to handle in a follow-up.
RikkiGibson commentedOct 12, 2020
@dotnet/roslyn-compiler for senior review |
RikkiGibson commentedOct 16, 2020
@dotnet/roslyn-compiler Please review |
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 (iteration 2)
jcouv commentedOct 19, 2020
Thanks@duracellko! |
Closes#48489
This implements
NotNullIfNotNullattribute on return type of user defined binary operators.