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

Feature Request: use "is null" instead of "== null" and vice versa #458

Closed
TobiasSekan opened this issue Nov 12, 2018 · 2 comments
Closed

Comments

@TobiasSekan
Copy link

TobiasSekan commented Nov 12, 2018

Hello,

It would be nice when rosylnator have code analysis and refactoring for
is null and == null

// before refactoring
if(parameter == null)
{
    parameter = newValue;
}

// after refactoring
if(parameter is null)
{
    parameter = newValue;
}

// and vice versa
  • Visual Studio 2017 - 15.9.0 - Preview 5.0
  • Roslynator 2017 - 2.0.0
@josefpihrt
Copy link
Collaborator

Are you proposing analyzer or refactoring?

@TobiasSekan
Copy link
Author

The first -> Analyzer (+ Code Fix)

Analyzer rules:

  1. use always == null instead of is null
  2. use always is null instead of == null

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