From: "shugo (Shugo Maeda)" Date: 2013-02-08T14:25:21+09:00 Subject: [ruby-core:52027] [ruby-trunk - Bug #7768][Open] Inherited Array class missing Issue #7768 has been updated by shugo (Shugo Maeda). Status changed from Closed to Open Assignee changed from charliesome (Charlie Somerville) to mame (Yusuke Endoh) I believe r39004 should be reverted. Matz said "If a method is originally defined in Enumerable, i.e. its return value (Array) is a collection of values from enumerable." at http://bugs.ruby-lang.org/issues/4136#note-7. However, Array#sort returns an instance of a subclass of Array, by r39004. $ ./ruby -ve 'class Foo < Array; end; p Foo[2,1,3].sort.class' ruby 2.0.0dev (2013-02-08 trunk 39154) [i686-linux] Foo I'm not sure Matz is right. What should Array#uniq return if Enumerable#uniq is added in the future? Anyway, there is no enough time to discuss details, so r39004 should be reverted. Haste makes waste. If this issue is regarded as a bug, not as a spec change, it can be fixed after the release of 2.0.0. ---------------------------------------- Bug #7768: Inherited Array class missing https://bugs.ruby-lang.org/issues/7768#change-36041 Author: england (Roman Ivanilov) Status: Open Priority: Normal Assignee: mame (Yusuke Endoh) Category: Target version: 2.0.0 ruby -v: 1.9 =begin Hello. I apologize if I missed something. I found strange behavior in ruby 1.9: 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. 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 -- http://bugs.ruby-lang.org/