SergeyTeplyakov / ErrorProne.NET

Set of roslyn-based analyzers for catching common C# errors (inspired by Google's error-prone)
MIT License
869 stars 43 forks source link

Warn when object.Equals is used for comparing structs #284

Open SergeyTeplyakov opened 2 months ago

SergeyTeplyakov commented 2 months ago

It seems that it can't be correct since boxing will create a new instance every time.

SergeyTeplyakov commented 2 months ago

The behavior is correct, but we'll box the arguments.

SergeyTeplyakov commented 2 months ago

object.ReferenceEquals for structs is meaningless.

SergeyTeplyakov commented 2 months ago

But for object.ReferenceEquals there is an existing fxcop rule.