Why an unused for
index variable causes an error (but not always)?
#2408
Unanswered
programandala-net
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First I have noticed a
for
unused index variable causes an error when there's a homonymous variable defined in the outer scope, instead of printing a warning (marked withXXX-4
in the example code below). That is my first doubt.Then I have noticed the error does not happen with a previous identical loop (marked with
XXX-2
in the example code). It seems it happens when the loop is the last one in the function: if loop 4 is moved to the top of the function, it is compiled; if loop 3 is copied below loop 4, i.e. at the bottom of the function, loop 4 is compiled as well. What am I missing? Or is it a bug?Thank you in advance.
Beta Was this translation helpful? Give feedback.
All reactions