Skip to content
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

Fix a typo in inheritance error message. #12199

Merged
merged 2 commits into from
Sep 21, 2023

Conversation

Octachron
Copy link
Member

Currently,

class empty = object end
class also_empty = object inherit! empty end

emits the following error message:

Error: This inheritance does not override any method instance variable

This PR fixes the missing or and plural between method and instance variable:

Error: This inheritance does not override any methods or instance variables.

Copy link
Contributor

@Julow Julow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the unrelated suggestion. I think this message could be clearer by stating why it is fired:

Error: This inheritance does not override any methods or instance variables
       but is marked as overriding with `!`.

An hint could be added to suggest to remove the ! but I'm worried it would be wrong in many cases (where the intended solution would be to add a method).

@Octachron
Copy link
Member Author

Thanks for the suggestion ! I agree that it is better to be more explicit with such infrequent error messages.

typing/typeclass.ml Outdated Show resolved Hide resolved
@Octachron
Copy link
Member Author

Updated with the new quoting style. @Julow are you fine with the current error message?

Copy link
Contributor

@Julow Julow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me :)

Copy link
Member

@gasche gasche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved on @Julow's behalf.

@gasche gasche merged commit 94c5327 into ocaml:trunk Sep 21, 2023
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants