Misleading error message when using [<CustomEquality>] or [<CustomComparison>] with a non-structural type
Open
Feature Improvement
- Dominant language
- F#
- Stars
- 4.3k
- Forks
- 876
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 131
Description
If you mistakenly add the `[]` or `[CustomComparison>]` (or both) attributes to a non-structural type then you get a very misleading error message:
```
[]
type T() =
override __.Equals(_) = true
```
> error FS0377: This type uses an invalid mix of the attributes 'NoEquality', 'ReferenceEquality', 'StructuralEquality', 'NoComparison' and 'StructuralComparison' attributes
This causes confusion (see e.g. [this](http://stackoverflow.com/questions/34981686/how-make-net-mutable-dictionaryt-t-with-structuralcomparison-equality-in-f) StackOverflow question).
Contributor guide
Assessment
This issue has not been assessed yet.