Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Bug in ri - cannot convert nil into Array

Reply
Thread Tools

Bug in ri - cannot convert nil into Array

 
 
John Carter
Guest
Posts: n/a
 
      01-17-2005
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 : http://www.velocityreviews.com/forums/(E-Mail 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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
string+char, cant convert nil, but not nil notnorwegian@yahoo.se Ruby 1 05-27-2008 04:57 AM
var = nil if false; p var.nil? #=> true | bug of the day ? Arie Kusuma Atmaja Ruby 6 04-11-2008 10:52 AM
Integer(nil) versus Float(nil) versus String(nil) Christoffer Sawicki Ruby 5 09-02-2006 06:28 PM
RCR 303: nil should accept missing methods and return nil John Carter Ruby 64 05-19-2005 12:12 PM
puts nil generates "nil\n" Brian Candler Ruby 1 11-06-2004 01:59 PM



Advertisments