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

Comparable and spaceship operator behavior changing #784

Closed
ryanatball opened this Issue May 3, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@ryanatball
Member

ryanatball commented May 3, 2018

If Comparable is included then <=> is used for comparisons. Currently ruby eats any exceptions thrown by <=> but this is changing in the future and it outputs warnings like this.

warning: Comparable#== will no more rescue exceptions of # in the next release.
warning: Return nil in # if the comparison is inappropriate or avoid such comparison.

Related Ruby bug report:
https://bugs.ruby-lang.org/issues/7688

The <=> operator in structure_item.rb and json_rpc.rb should be updated to ensure that they don't raise exceptions for cases such as comparing against nil or with objects that don't support an expected method.

ryanatball added a commit that referenced this issue May 16, 2018

Merge pull request #798 from BallAerospace/spaceship_updates
closes #784 update spaceship operators exception behavior

@ryanatball ryanatball added this to the v4.2.4 milestone May 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment