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

Do not pass value types to Object.ReferenceEquals #33766

Closed
terrajobst opened this issue Mar 19, 2020 · 2 comments
Closed

Do not pass value types to Object.ReferenceEquals #33766

terrajobst opened this issue Mar 19, 2020 · 2 comments
Labels
area-System.Runtime code-analyzer Marks an issue that suggests a Roslyn analyzer
Milestone

Comments

@terrajobst
Copy link
Member

Calls to ReferenceEquals where we can detect a value type is being passed in are invariably wrong, as the value type will be boxed, and regardless of its value, ReferenceEquals will always return false.

Category: Reliability

@terrajobst terrajobst added api-suggestion Early API idea and discussion, it is NOT ready for implementation area-System.Runtime code-analyzer Marks an issue that suggests a Roslyn analyzer labels Mar 19, 2020
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Mar 19, 2020
@bartonjs
Copy link
Member

Fixed in dotnet/roslyn-analyzers#3368.

@bartonjs bartonjs added this to the 5.0 milestone Mar 19, 2020
@bartonjs bartonjs removed the untriaged New issue has not been triaged by the area owner label Mar 19, 2020
@bartonjs bartonjs removed the api-suggestion Early API idea and discussion, it is NOT ready for implementation label Mar 20, 2020
@jeffhandley
Copy link
Member

Estimates:

  • Analyzer: Small
  • Fixer: Not Applicable

@ghost ghost locked as resolved and limited conversation to collaborators Dec 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Runtime code-analyzer Marks an issue that suggests a Roslyn analyzer
Projects
None yet
Development

No branches or pull requests

4 participants