Fix `A.new([[1,2],3]).flatten` to return `Array`.

parent 4e535080
...@@ -209,7 +209,7 @@ class Array ...@@ -209,7 +209,7 @@ class Array
# a.flatten(1) #=> [1, 2, 3, [4, 5]] # a.flatten(1) #=> [1, 2, 3, [4, 5]]
# #
def flatten(depth=nil) def flatten(depth=nil)
res = dup res = Array.new(self)
res.flatten! depth res.flatten! depth
res res
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment