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

Static optimizer breaks meta-assign to Array/Hashes returned from methods #1989

Closed
zoffixznet opened this issue Jun 28, 2018 · 0 comments
Closed
Assignees
Labels
QAST issues that require working with QAST to fix

Comments

@zoffixznet
Copy link
Contributor

$ perl6 -e 'class Foo { has @.things is rw }; my $o := Foo.new; dd $o.things += <a b c>'
Cannot assign to an immutable value
  in block <unit> at -e line 1

$ perl6 --optimize=off -e 'class Foo { has @.things is rw }; my $o := Foo.new; dd $o.things += <a b c>'
Array @!things = [3]

$ perl6 -v
This is Rakudo version 2018.05-54-g148d7c5 built on MoarVM version 2018.05-57-g89dee3b
implementing Perl 6.c.
@zoffixznet zoffixznet added the QAST issues that require working with QAST to fix label Jun 28, 2018
@zoffixznet zoffixznet self-assigned this Jun 28, 2018
zoffixznet added a commit that referenced this issue Jun 28, 2018
Fixes R#1987 #1987
Fixes R#1989 #1989
Fixes #1981 R#1981

For opts: mark applicable METAOP constructs, so that when we
get to optimize nested chains, we can see that these are fine
to optimize further.

For bugs: swap `assign` to `p6store` op in the opt which both
handles arrays/hashes correctly and throws better RO exceptions
ugexe pushed a commit to Raku/roast that referenced this issue Dec 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
QAST issues that require working with QAST to fix
Projects
None yet
Development

No branches or pull requests

1 participant