Julia for-loop variable scoping #25724
Labels
bug
Indicates an unexpected problem or unintended behavior
compiler:lowering
Syntax lowering (compiler front end, 2nd stage)
Compare the following nearly identical bits of code:
Output:
Now a statement that should do nothing (
X=X
) to get:to get the output
Another interesting variant on this theme:
output
Adding the
x=x
ory=y
statements retains thex
variables in the first loop but not they
variables.Perhaps an indication that the soft scoping rules of for-loops are a bit too baroque.
Version used for testing:
The text was updated successfully, but these errors were encountered: