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

Arrays are not captured in closures #139

Closed
kikofernandez opened this issue Apr 24, 2015 · 2 comments
Closed

Arrays are not captured in closures #139

kikofernandez opened this issue Apr 24, 2015 · 2 comments

Comments

@kikofernandez
Copy link
Contributor

Given the following example

class Main
  def main(): void
    let arr = [1, 2, 3] in
      repeat i <- |arr|
        let fn = \() -> print arr[i] in
           fn()

the closure doesn't capture the array and the i variable in the environment. Same for async

@kikofernandez
Copy link
Contributor Author

I believe this is a simple fix, so I'll fix it

@kikofernandez
Copy link
Contributor Author

closed by @EliasC PR #147

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

1 participant