-
Notifications
You must be signed in to change notification settings - Fork 847
Closed
Labels
Description
type T() =
interface System.IEquatable<T> with member x.Equals _ = true
override x.Equals _ = failwith "non-generic equality"
override x.GetHashCode() = 0
T() = T() // System.Exception: non-generic equalityThe current .Net advice is: If you implement IEquatable, you should also override ... Equals(Object).
The reason for this advice is: Non-Strongly typed collections and Frameworks don’t use IEquatable.
However now DE0006: Non-generic collections shouldn't be used.
So the expectation is that if you don't use .Net collections that predate generics, which you shouldn't do, then non-generic equality will not be used in preference to generic equality.