issues
search
MajeedKazemi
/
code-struct
A new text-based environment that helps beginners transition into conventional text-based programming environments.
http://code-struct.vercel.app
GNU General Public License v3.0
26
stars
10
forks
source link
Deleting for loop counter variable triggers warnings on reference even if the variable is defined in the parent scope
#570
Closed
vicchig
closed
2 years ago
vicchig
commented
2 years ago
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 because
x
is still declared outside of the loop in its parent scope.
Related: #565
x = 123
for x in [1,2,3]
print(x + 5)
inside the body of the loop.x
in the for loop.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.Related: #565