Skip to content

Conversation

mtasaka
Copy link
Contributor

@mtasaka mtasaka commented Feb 21, 2021

With ruby 3.0, especially with ruby/ruby#3690 ,
for subclass of Array, flatten method now returns the instance of Array,
not of the subclass.

To keep the object instance of the subclass, use flatten! instead.

Fixes #254

With ruby 3.0, especially with ruby/ruby#3690 ,
for subclass of Array, `flatten` method now returns the instance of Array,
not of the subclass.

To keep the object instance of the subclass, use `flatten!` instead.
@qlty-cloud-legacy
Copy link

Code Climate has analyzed commit c1c1503 and detected 0 issues on this pull request.

View more on Code Climate.

@junaruga
Copy link
Contributor

junaruga commented Mar 1, 2021

@rubychan Could you take a look at this PR? You can also add Ruby 3.0 case to this repo's Travis CI to see the result. Thanks.

@korny
Copy link
Member

korny commented Mar 1, 2021

Thank you for the fix!

@korny korny merged commit 4982353 into rubychan:master Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ruby 3.0: test/unit/suite.rb fails due to change in flatten behavior for subclass of Array
3 participants