Skip to content

Commit

Permalink
Numeric#<=> should return nil on failed coercion
Browse files Browse the repository at this point in the history
  • Loading branch information
meh committed Oct 18, 2013
1 parent f93e7bc commit b73e1e7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions corelib/numeric.rb
Expand Up @@ -175,6 +175,8 @@ def <=>(other)
return #{send_coerced :<=>, other};
}
}
rescue TypeError
nil
end

def <<(count)
Expand Down

0 comments on commit b73e1e7

Please sign in to comment.