Bug #2365: Matrix: poor handling of coercion errors [patch]
http://redmine.ruby-lang.org/issues/show/2365

Author: Marc-Andre Lafortune
Status: Open, Priority: Normal
Assigned to: Keiju Ishitsuka, Category: lib, Target version: 1.9.2
ruby -v: ruby 1.9.2dev (2009-11-08 trunk 25690) [x86_64-darwin10.0.0]

rubydev -r matrix -e 'p Matrix.I(2) - nil'
/usr/local/rubydev/lib/ruby/1.9.1/matrix.rb:533:in `-': undefined method `coerce' for nil:NilClass (NoMethodError)
	from -e:1:in `<main>'

Expected:
some_where_in_the/matrix.rb:in `-': nil can't be coerced into Matrix (TypeError)
	from -e:1:in `<main>'


Same situation with Vector.

I'd be grateful if you could confirm the attached patch is ok.


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