Skip to content

Instantly share code, notes, and snippets.

@ryantm
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryantm/c132d2c0ba77b4a9011a to your computer and use it in GitHub Desktop.
Save ryantm/c132d2c0ba77b4a9011a to your computer and use it in GitHub Desktop.
Ruby comparison eats stack trace
#$ chruby ruby-2.2.0
#$ ruby this_file.rb
class A
def <=>(other)
nil
end
end
A.new <=> A.new #no error
[A.new,A.new].sort
#ruby_compare.rb:12:in `sort': comparison of A with A failed (ArgumentError)
# from ruby_compare.rb:12:in `<main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment