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

[ruby] Shadowing in lambda functions #4852

Open
AndreiDreyer opened this issue Aug 15, 2024 · 0 comments
Open

[ruby] Shadowing in lambda functions #4852

AndreiDreyer opened this issue Aug 15, 2024 · 0 comments
Labels
ruby Relates to rubysrc2cpg

Comments

@AndreiDreyer
Copy link
Contributor

In the following code sample, the x in the do block shadows the x = 1 variable outside of the block, however the current implementation captures the x inside the do block as the x = 1 outside of the do block.

def foo(&block)
  block.call(2)
end

x = 1
foo do |x|
  puts x
end
@AndreiDreyer AndreiDreyer added the ruby Relates to rubysrc2cpg label Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ruby Relates to rubysrc2cpg
Projects
None yet
Development

No branches or pull requests

1 participant