Bug in ri - cannot convert nil into Array

J

John Carter

There seems to be a Bug in "ri" in the CVS-Latest (17-Jan-2005) version of
Ruby.

ri Set | cat
/usr/local/lib/ruby/1.9/rdoc/ri/ri_descriptions.rb:99:in `concat': cannot
convert nil into Array (TypeError)
from /usr/local/lib/ruby/1.9/rdoc/ri/ri_descriptions.rb:99:in
`merge_in'
from /usr/local/lib/ruby/1.9/rdoc/ri/ri_reader.rb:56:in
`get_class'
from /usr/local/lib/ruby/1.9/rdoc/ri/ri_reader.rb:52:in `each'
from /usr/local/lib/ruby/1.9/rdoc/ri/ri_reader.rb:52:in
`get_class'
from /usr/local/lib/ruby/1.9/rdoc/ri/ri_reader.rb:31:in
`find_class_by_name'
from /usr/local/lib/ruby/1.9/rdoc/ri/ri_display.rb:97:in
`display_class_info'
from /usr/local/lib/ruby/1.9/rdoc/ri/ri_display.rb:96:in `each'
from /usr/local/lib/ruby/1.9/rdoc/ri/ri_display.rb:96:in
`display_class_info'
from /usr/local/lib/ruby/1.9/rdoc/ri/ri_display.rb:77:in `page'
from /usr/local/lib/ruby/1.9/rdoc/ri/ri_display.rb:77:in
`display_class_info'
from /usr/local/lib/ruby/1.9/rdoc/ri/ri_driver.rb:71:in
`report_class_stuff'
from /usr/local/lib/ruby/1.9/rdoc/ri/ri_driver.rb:106:in
`get_info_for'
from /usr/local/lib/ruby/1.9/rdoc/ri/ri_driver.rb:135:in
`process_args'
from /usr/local/lib/ruby/1.9/rdoc/ri/ri_driver.rb:134:in `each'
from /usr/local/lib/ruby/1.9/rdoc/ri/ri_driver.rb:134:in
`process_args'
from /usr/local/bin/ri:48
------------------------------------------------------------- Class: Set
Set implements a collection of unordered values with no duplicates.
This is a hybrid of Array's intuitive inter-operation facilities
and Hash's fast lookup.

Several methods accept any Enumerable object (implementing +each+)
for greater flexibility: new, replace, merge, subtract, |, &, -, ^.

The equality of each couple of elements is determined according to
Object#eql? and Object#hash, since Set uses Hash as storage.

Finally, if you are using class Set, you can also use
Enumerable#to_set for convenience.


Example
-------
require 'set'
s1 = Set.new [1, 2] # -> #<Set: {1, 2}>
s2 = [1, 2].to_set # -> #<Set: {1, 2}>
s1 == s2 # -> true
s1.add("foo") # -> #<Set: {1, 2, "foo"}>
s1.merge([2, 6]) # -> #<Set: {6, 1, 2, "foo"}>
s1.subset? s2 # -> false
s2.subset? s1 # -> true

------------------------------------------------------------------------


Includes:
---------

====================================================================

If I have a look at
/usr/local/lib/ruby/1.9/rdoc/ri/ri_descriptions.rb:99, I see...
# merge in another class desscription into this one
def merge_in(old)
merge(@class_methods, old.class_methods)
merge(@instance_methods, old.instance_methods)
merge(@attributes, old.attributes)
merge(@constants, old.constants)
merge(@includes, old.includes)
if @comment.nil? || @comment.empty?
@comment = old.comment
else
@comment << SM::Flow::RULE.new
@comment.concat old.comment
end
end

Where line 99 is...
@comment.concat old.comment

I take it then "old.comment" is nil

Give me a yell if you want me to doing any testing / instrumenting of this
for you.



John Carter Phone : (64)(3) 358 6639
Tait Electronics Fax : (64)(3) 359 4632
PO Box 1645 Christchurch Email : (e-mail address removed)
New Zealand

"The notes I handle no better than many pianists. But the pauses
between the notes -
ah, that is where the art resides!' - Artur Schnabel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,054
Latest member
LucyCarper

Latest Threads

Top