Skip to content

Ruby: Cosmetic change #11150

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

Merged
merged 1 commit into from
Nov 7, 2022
Merged

Ruby: Cosmetic change #11150

merged 1 commit into from
Nov 7, 2022

Conversation

hmac
Copy link
Contributor

@hmac hmac commented Nov 7, 2022

@github-actions github-actions bot added the Ruby label Nov 7, 2022
@erik-krogh
Copy link
Contributor

You have to user super.method(..) in the body of the predicates.

@hmac
Copy link
Contributor Author

hmac commented Nov 7, 2022

I don't really see how this is an improvement over the original but 🤷

@hmac hmac added the no-change-note-required This PR does not need a change note label Nov 7, 2022
@erik-krogh erik-krogh marked this pull request as ready for review November 7, 2022 22:20
@erik-krogh erik-krogh requested a review from a team as a code owner November 7, 2022 22:20
Copy link
Contributor

@erik-krogh erik-krogh left a comment

Choose a reason for hiding this comment

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

I don't really see how this is an improvement over the original but 🤷

It's not a big issue in Ruby, but in JS it can be a foot-gun.
E.g. our PropRead class is abstract, so using extends can be a real foot-gun.
So that a reason why I like to use instanceof instead of extends in cases like these.

@hmac
Copy link
Contributor Author

hmac commented Nov 7, 2022

Ah I see - for the same reason I believe we don't tend to use abstract classes much in Ruby outside of the Range pattern, so it's a bit more obvious.

@hmac hmac merged commit 8c8f141 into github:main Nov 7, 2022
@hmac hmac deleted the try-fixup branch November 7, 2022 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-change-note-required This PR does not need a change note Ruby
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants