Skip to content
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

Inccorect 'Null check can be simplified' #25588

Closed
vsfeedback opened this issue Mar 19, 2018 · 3 comments
Closed

Inccorect 'Null check can be simplified' #25588

vsfeedback opened this issue Mar 19, 2018 · 3 comments
Labels
Developer Community The issue was originally reported on https://developercommunity.visualstudio.com

Comments

@vsfeedback
Copy link

The null check of a generic argument must be done with a 'if', but intelisense says we can simplified with the '??' operator. But the '??' operator is valid only if the Type of the generic argument has the 'class' constraint, the intellisense don't care about that.

This issue has been moved from https://developercommunity.visualstudio.com/content/problem/211735/inccorect-null-check-can-be-simplified-1.html
VSTS ticketId: 579839

These are the original issue comments:
(no comments)
These are the original issue solutions:
(no solutions)

@Neme12
Copy link
Contributor

Neme12 commented Mar 19, 2018

I tried to reproduce this in 15.6.2 but only get the fix offered if I add a class constraint. Could you try updating to a new version and see if the problem persists? Thanks!

@Neme12
Copy link
Contributor

Neme12 commented Mar 19, 2018

This seems like it got fixed in #24173 but merged into 15.7, not 15.6? Maybe there's something wrong with my setup.

@thomasouvre
Copy link

@Neme12 I updated my VS from the 15.5.7 to 15.6.3 version and it's now fixed. Thank you !

@jmarolf jmarolf closed this as completed Mar 20, 2018
@sharwell sharwell added the Developer Community The issue was originally reported on https://developercommunity.visualstudio.com label Nov 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Developer Community The issue was originally reported on https://developercommunity.visualstudio.com
Projects
None yet
Development

No branches or pull requests

5 participants