You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As noted in #440, the ReferenceEquality check doesn't flag enum comparisons. The documentation on the other hand seems to claim otherwise:
But enum values are always unique, so can’t I compare them with ==?
Yes, but that might confuse the reader, who must understand that your type has special properties because it’s an enum. Using equals everywhere can work the same everywhere; special-casing for enums isn’t worth it.
I assume (hope) that the documentation is merely outdated. I can open a PR to drop this section, but perhaps it should be replaced with some text explaining that Enum and Class comparisons are excluded. WDYT?
The text was updated successfully, but these errors were encountered:
…heck them.
I considered rephrasing it to say that using #equals is preferred but not enforced by this check, but mentioning them at all seems confusing.
Fixes#783
RELNOTES: Tweak documentation for ReferenceEquality
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=212956380
…heck them.
I considered rephrasing it to say that using #equals is preferred but not enforced by this check, but mentioning them at all seems confusing.
Fixes#783
RELNOTES: Tweak documentation for ReferenceEquality
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=212956380
As noted in #440, the
ReferenceEquality
check doesn't flag enum comparisons. The documentation on the other hand seems to claim otherwise:I assume (hope) that the documentation is merely outdated. I can open a PR to drop this section, but perhaps it should be replaced with some text explaining that
Enum
andClass
comparisons are excluded. WDYT?The text was updated successfully, but these errors were encountered: