-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
for-loop in top-level if-block blocks variable re-binding the first time around. #17387
Comments
Another, case which seems related:
again running it the second time works. (If this is a different issue, let me know and I'll file it separately.) |
Since a for-loop allocates local variables freshly for every iteration, http://docs.julialang.org/en/latest/manual/variables-and-scoping/#man-for-loops-scope , the second case has a partial explanation. In the second loop iteration, Maybe a different issue from the first. |
The following code also has the same issue:
Something to do with for-loop scoping in top-level if statements. |
@everywhere
in if-block blocks variable re-binding
What should this be labelled under? |
Might be related to #18933 |
This changes the meaning of `global` from being a directive when used at toplevel, which forces the introduction of a new global when used in certain contexts, to always being just an scope annotation that there should exist a global binding for the given name. fix #18933 fix #17387 (for the syntactic case)
This changes the meaning of `global` from being a directive when used at toplevel, which forces the introduction of a new global when used in certain contexts, to always being just an scope annotation that there should exist a global binding for the given name. fix #18933 fix #17387 (for the syntactic case)
This changes the meaning of `global` from being a directive when used at toplevel, which forces the introduction of a new global when used in certain contexts, to always being just an scope annotation that there should exist a global binding for the given name. fix #18933 fix #17387 (for the syntactic case)
This changes the meaning of `global` from being a directive when used at toplevel, which forces the introduction of a new global when used in certain contexts, to always being just an scope annotation that there should exist a global binding for the given name. fix #18933 fix #17387 (for the syntactic case)
Note that: the
if
and@everywhere
is necessary. Exchanging theif
with alet
orfor
stops the bug. Executing the the if-block again does not error again. Works on 0.4.The text was updated successfully, but these errors were encountered: