Issue #1648 has been updated by Marc-Andre Lafortune.


Maybe I should have justified further?

In any Ruby:
$ ruby -e '1 + nil'
-e:1:in `+': nil can't be coerced into Fixnum (TypeError)
$ ruby -e '1.2 + nil'
-e:1:in `+': nil can't be coerced into Float (TypeError)
$ ruby -e '(1<<66) + nil'
-e:1:in `+': nil can't be coerced into Bignum (TypeError)
$ ruby -r bigdecimal -e 'BigDecimal("1.2") + nil'
-e:1:in `+': nil can't be coerced into BigDecimal (TypeError)

In Ruby 1.9:
$ ruby -e 'Complex(1,2) + nil'
-e:1:in `+': nil can't be coerced into Complex (TypeError)
$ ruby -e 'Rational(1,2) + nil'
-e:1:in `+': nil can't be coerced into Rational (TypeError)

This change was thus made for consistency with other mathematical classes and for consistency with Rational class of Ruby 1.9.

----------------------------------------
http://redmine.ruby-lang.org/issues/show/1648

----------------------------------------
http://redmine.ruby-lang.org