Project

General

Profile

Bug #7768

Updated by ko1 (Koichi Sasada) over 5 years ago

=begin 
 Hello. I apologize if I missed something. 
 I found strange behavior in ruby 1.9: 

 ```ruby 
  

  class Custom < Array; end 
  Custom.new(0){|i| i + 1}.uniq.class # => Array 
  Custom.new(2){|i| i + 1}.uniq.class # => Custom 
 ``` 

 while in 1.8 it works just as I expected.  

 ```ruby 
   

  class Custom < Array; end 
  Custom.new(0){|i| i + 1}.uniq.class # => Custom 
  Custom.new(2){|i| i + 1}.uniq.class # => Custom 
 ``` 

 * it is actual not only for the uniq method. 
 * tested with ree-1.8.7-2010.02, ruby-1.9.2-p290, ruby-1.9.3-p375, ruby-1.9.3-p125 

 Any bug here? 
 

 =end

Back