Issue #2365 has been updated by Run Paint Run Run.


> This behavior is the same as an integer: 
>
> % ruby-dev -r matrix -e "p 2 - nil"
> -e:1:in `-': nil can't be coerced into Fixnum (TypeError)
        from -e:1:in `<main>'

> I think that these behavior is Ruby's standard behavior.

As Marc-André explained, the behaviour is demonstrably different: Integer, correctly, raises a TypeError, whereas Matrix raises a NoMethodError. The latter is misleading because it exposes an irrelevant implementation detail (the use of #coerce) rather than describing the problem from the caller's perspective. The message associated with the exception is similarly wanting.
----------------------------------------
http://redmine.ruby-lang.org/issues/show/2365

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