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

@async / let block scope issue #15576

Closed
vtjnash opened this issue Mar 21, 2016 · 2 comments
Closed

@async / let block scope issue #15576

vtjnash opened this issue Mar 21, 2016 · 2 comments

Comments

@vtjnash
Copy link
Member

vtjnash commented Mar 21, 2016

the @async block is creating a new variable instead of capturing the intended one from the let block (due to the presence of a global of the same name)

julia> t = 3
3

julia> let t
           c = Condition()
           task = @async begin
               notify(c)
               t = Timer(0.055)
               wait(t)
           end
           wait(task)
           println(t)
       end
ERROR: UndefVarError: t not defined
 in eval(::Module, ::Any) at ./boot.jl:243
@amitmurthy
Copy link
Contributor

Shouldn't the let statement be let t=t? With that change the above code block works fine.

@amitmurthy
Copy link
Contributor

But the issue raised by you seems similar to #14399

@vtjnash vtjnash closed this as completed Feb 13, 2017
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