Skip to content

Splat operator to frozen Array raises FrozenError #5067

@shibafu528

Description

@shibafu528

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions