Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged

Conversation

@duracellko
Copy link
Contributor

Closes#48489

This implementsNotNullIfNotNull attribute on return type of user defined binary operators.

@duracellkoduracellko requested a review froma team as acode ownerOctober 10, 2020 13:54
@RikkiGibsonRikkiGibson self-assigned thisOct 10, 2020
@RikkiGibsonRikkiGibson added Area-Compilers CommunityThe pull request was submitted by a contributor who is not a Microsoft employee. Feature - Nullable Reference TypesNullable Reference Types labelsOct 10, 2020
(c1 / c2).ToString(); // no warn
(c1 / cn2).ToString(); // warn
(cn1 / c2).ToString(); // no warn
(cn1 / cn2).ToString(); // warn
Copy link
Member

@RikkiGibsonRikkiGibsonOct 12, 2020
edited by jcouv
Loading

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

duracellko reacted with thumbs up emoji
Copy link
ContributorAuthor

@duracellkoduracellkoOct 13, 2020
edited by jcouv
Loading

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

Copy link
Member

@RikkiGibsonRikkiGibson left a comment
edited
Loading

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
Copy link
Member

@dotnet/roslyn-compiler for senior review

@RikkiGibson
Copy link
Member

@dotnet/roslyn-compiler Please review

@jcouvjcouv self-assigned thisOct 19, 2020
Copy link
Member

@jcouvjcouv left a 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)

@jcouvjcouv merged commit1a258ac intodotnet:masterOct 19, 2020
@ghostghost added this to theNext milestoneOct 19, 2020
@jcouv
Copy link
Member

Thanks@duracellko!

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@RikkiGibsonRikkiGibsonRikkiGibson approved these changes

@jcouvjcouvjcouv approved these changes

Labels

Area-CompilersCommunityThe pull request was submitted by a contributor who is not a Microsoft employee.Feature - Nullable Reference TypesNullable Reference Types

Projects

None yet

Milestone

16.9.P2

Development

Successfully merging this pull request may close these issues.

NotNullIfNotNull attribute does not work with binary operators

4 participants

@duracellko@RikkiGibson@jcouv@allisonchou

[8]ページ先頭

©2009-2025 Movatter.jp