From: "txemagon (José M. González)" Date: 2013-05-25T19:48:04+09:00 Subject: [ruby-core:55162] [ruby-trunk - Feature #8449][Open] Array#ary_plus always returns an array Issue #8449 has been reported by txemagon (Jos�� M. Gonz��lez). ---------------------------------------- Feature #8449: Array#ary_plus always returns an array https://bugs.ruby-lang.org/issues/8449 Author: txemagon (Jos�� M. Gonz��lez) Status: Open Priority: Normal Assignee: Category: Target version: =begin Even when Array is subclassified, + operator keeps on returning an Array. Don't know if it is a bug or intentional, but it has surprised me for sure. I paste some code for demonstrational purposes: #!/usr/bin/env ruby #ary_plus.rb # Shows an unexpected behavior to me # when adding Array subclasess. class Subarray < Array; end a = Subarray.new b = Subarray.new result = a + b # I was expecting to have a Subarray back unless result.is_a? Subarray puts "result is not a [Subarray]" end puts "result variable is a [#{result.class.name}]" =end -- http://bugs.ruby-lang.org/