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 Suggests to eliminate meaningful parentheses in pattern #2530

Closed
wilhelmzapiain opened this issue Sep 9, 2017 · 6 comments
Closed

Comments

@wilhelmzapiain
Copy link

The following code:

    !(item is null) && SomePredicate(item.Property)

triggers SA1119 with the proposed change:

    !item is null && SomePredicate(item.Property)

which is has the wrong semantics.

SA1119 should not trigger in this case.

@sharwell
Copy link
Member

sharwell commented Sep 9, 2017

❓ What version of StyleCop Analyzers are you using? I would expect this to be fixed along with #2372 for release 1.1.0-beta004.

@wilhelmzapiain
Copy link
Author

Updating to release 1.1.0-beta004 removes StyleCop from the available analyzers. How do I set it up?

@sharwell
Copy link
Member

sharwell commented Sep 9, 2017

What version of Visual Studio are you using? 1.1.x require Visual Studio 2015 Update 2 (or anything newer).

@wilhelmzapiain
Copy link
Author

Community 2017 15.3.3

@sharwell
Copy link
Member

sharwell commented Sep 9, 2017

Thanks. Can you try this?

  1. Uninstall StyleCop Analyzers
  2. Save everything and close Visual Studio
  3. Open Visual Studio again, install StyleCop Analyzers 1.1.0-beta004
  4. Save everything and restart Visual Studio again

See if we can't "kick it back into working order"

@wilhelmzapiain
Copy link
Author

Weird heinsenbug. Had already tried, but know it worked.
All is in working order. Thank you very much.

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

No branches or pull requests

2 participants