-
Notifications
You must be signed in to change notification settings - Fork 771
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
Misleading error message when using [<CustomEquality>] or [<CustomComparison>] with a non-structural type #960
Comments
@vzarytovskii what could be done to improve this error message? |
@nojaf Suggestions: 1. Explain valid combinations. 2. Add documentation about this error message, as far as I see there is none yet. |
Jeesh, pick another writing style to address me there pal. |
AFAIU, those attributes shouldn't be a valid thing when tucked on ad-hoc structs/classes, so it is good it is an error already. For this particular case, the error message could be:
Only drawback of this message is, if we come up with more of such types where the attributes are invalid/valid, then the message will need tweak. The current error message bothers me a bit with "attributes" being repeated. In meantime, "Jeesh" isn't offended of being addressed in any style 🙂 and users are sometimes exclamatory when addressing the compiler as an entity or simply greeting others! |
If you mistakenly add the
[<CustomEquality>]
or[CustomComparison>]
(or both) attributes to a non-structural type then you get a very misleading error message:This causes confusion (see e.g. this StackOverflow question).
The text was updated successfully, but these errors were encountered: