From: Run Paint Run Run Date: 2010-03-30T00:43:22+09:00 Subject: [ruby-core:29107] [Bug #2365] Matrix: poor handling of coercion errors [patch] 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 `
' > 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