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

SA1119 patches may cause code to be unenforceable #2940

Closed
ymh199478 opened this issue Apr 19, 2019 · 2 comments
Closed

SA1119 patches may cause code to be unenforceable #2940

ymh199478 opened this issue Apr 19, 2019 · 2 comments

Comments

@ymh199478
Copy link

The following code causes SA1119:

public void Foo(string str, int num)
{
    if (!(str is null) && num > 10)
    {
    }
}

After repairing according to the patch:

public void Foo(string str, int num)
{
    if (!str is null && num > 10)
    {
    }
}

Code: !str is null it is invalid

@sharwell
Copy link
Member

Duplicate of #2372

@sharwell sharwell marked this as a duplicate of #2372 Apr 19, 2019
@ymh199478
Copy link
Author

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants