Skip to content

Array(array) returns a copy instead of array itself #1176

@DawidJanczak

Description

@DawidJanczak
[1] pry(main)> arr = [1]
=> [1]
[3] pry(main)> arr.equal? Array(arr)
=> false

The commit that introduced the change: 0ed823a

MRI returns the same object on Array(arr), arr.to_a and arr.to_ary when arr is an Array.
JRuby returns a copy in the first case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions