-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Nested captured block looses scope and crashes compiler #227
Comments
Apparently the first block is considered a closure by the compiler, which is wrong. It'll be a good opportunity to clean up the closure detection algorithm, which is rather ugly now :-) |
I guess this is the same one: def foo(&block)
block.call
end
foo do
a = 1.5
->(x : Int32) { x + a }
end |
Here's the smallest one that crashes the compiler: ->{ a = 1; ->{ a } } Basically, a proc inside another one, the nested one being a closure inside the outer one. But the compiler thinks the outer one forms a closure over I think it's easy to fix but I'd like to refactor some things while fixing this so the code is clearer. |
Sure, take your time. |
The text was updated successfully, but these errors were encountered: