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

control flow blocks with local assignments should not be rewritten as postfix expressions #10

Closed
flavorjones opened this issue Dec 9, 2021 · 1 comment

Comments

@flavorjones
Copy link

Using syntax_tree v1.1.0. Rewriting the following code:

n = 1

if (b = n+1) > 1
  puts b
end

is rewritten as:

n = 1

puts b if (b = n + 1) > 1

which will cause an "undefined local variable or method" NameError exception to be raised.

@kddnewton
Copy link
Member

Fixed by 802d647 and will be out in 1.1.1

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

2 participants