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
Variables in nested closures #864
Comments
Things messed up when variable appears.
|
It seems to be a bug in VariableDecl -> captureInUpstreamClosures -> intermediateScopeIndex |
A related problem(UNRESOLVED):
Expect: 3 because rock generate &(&ret) in nested closure... |
My example (for the original issue, not #882) func1 := func {
a := 1
b := 2
func2 := func {
"#{a + b}" println()
}
func2()
}
func1() Note that if you change |
Should it be possible to create a closure inside another closure? Because it is in that case not possible to use variables created in the parent closure in the child closure.
Example code:
fails with:
The text was updated successfully, but these errors were encountered: