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
  1. Create a variable x = 123
  2. Create a for loop for x in [1,2,3]
  3. Insert print(x + 5) inside the body of the loop.
  4. Remove the identifier x in the for loop.
  5. 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