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

Incorrect handling of setindex! expressions #30

Open
MasonProtter opened this issue Aug 10, 2022 · 1 comment
Open

Incorrect handling of setindex! expressions #30

MasonProtter opened this issue Aug 10, 2022 · 1 comment

Comments

@MasonProtter
Copy link

x should be global in both of these:

julia> solve_from_local(:(x[] = 1))
:($(Expr(:scoped, (bounds = Var[@local x], freevars = Var[], bound_inits = Symbol[]), :((@local x)[] = 1))))

julia> solve_from_local(:(setindex!(x, 1)))
:($(Expr(:scoped, (bounds = Var[], freevars = Var[], bound_inits = Symbol[]), :((@global setindex!)(@global x, 1)))))
@MasonProtter
Copy link
Author

Maybe the solution is having simplify_ex turn x[inds...] = y into setindex!(x, y, inds...)?

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