Variables are considered undefined during some for loop interactions #571
Closed
Description
- Create a variable
x = 123
- Create a for loop
for x in [1,2,3]
- Insert
print(x + 5)
inside the body of the loop. - Remove the identifier
x
in the for loop. - Navigate off the loop statement and observe that the reference to
x
inside the print is marked with a warning even though it should not be becausex
is still declared outside of the loop in its parent scope. - Navigate to the declaration of
x
outside of the for loop (above). - Navigate off of it and observe that the warning is removed and so is the variable button for
x
even though it is still defined.