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

Tuple assignment incorrect #774

Closed
d3zd3z opened this issue Apr 18, 2014 · 2 comments
Closed

Tuple assignment incorrect #774

d3zd3z opened this issue Apr 18, 2014 · 2 comments
Assignees
Milestone

Comments

@d3zd3z
Copy link

d3zd3z commented Apr 18, 2014

The following code

a := 1
b := 2
(a, b) = (b, a+b)

generates the incorrect result. The generated code doesn't use a temporary, and clobbers the value of 'a' before computing 'a+b'. A simpler expression, such as

(a, b) = (b, a)

does seem to work.

@horasal
Copy link
Contributor

horasal commented Jun 27, 2014

As a temporary solution, if a member is not variableAccess, temporary variable will be used.
Here's my code but I think it can be done better.

horasal@e9100a3

@fasterthanlime
Copy link
Collaborator

@zhaihj, your code doesn't look too bad :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants