Project

General

Profile

Actions

Bug #2365

closed

Matrix: poor handling of coercion errors [patch]

Added by marcandre (Marc-Andre Lafortune) over 14 years ago. Updated almost 13 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 1.9.2dev (2009-11-08 trunk 25690) [x86_64-darwin10.0.0]
Backport:
[ruby-core:26736]

Description

=begin
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 `'

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

Same situation with Vector.

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


Files

matrix_coercion.diff (3.76 KB) matrix_coercion.diff marcandre (Marc-Andre Lafortune), 11/14/2009 10:35 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0