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

Fix S2701: rule should ignore bool? assertions #1874

Closed
valhristov opened this issue Sep 24, 2018 · 0 comments
Closed

Fix S2701: rule should ignore bool? assertions #1874

valhristov opened this issue Sep 24, 2018 · 0 comments
Assignees
Labels
Type: False Positive Rule IS triggered when it shouldn't be.
Milestone

Comments

@valhristov
Copy link
Contributor

valhristov commented Sep 24, 2018

Description

The following causes rule S2701 to fire:

        bool? x = false;
        Assert.AreEqual(false, x);

However, the suggested change fails to compile:

        Assert.IsFalse(x);

Original request: https://community.sonarsource.com/t/should-s2701-apply-to-bool-datatypes/2435

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: False Positive Rule IS triggered when it shouldn't be.
Projects
None yet
Development

No branches or pull requests

2 participants