Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Splat operator to frozen Array raises FrozenError #5067

Closed
shibafu528 opened this issue Aug 28, 2020 · 0 comments
Closed

Splat operator to frozen Array raises FrozenError #5067

shibafu528 opened this issue Aug 28, 2020 · 0 comments

Comments

@shibafu528
Copy link

I tried to use splat operator when appends value to the frozen array, but it raises FrozenError in mruby 2.1.2.
I'll expect to get similar results to CRuby.

x = [1, 2].freeze
y = [*x, 3]
p y
% ruby a.rb 
[1, 2, 3]
% mruby a.rb
can't modify frozen Array (FrozenError)
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

No branches or pull requests

1 participant