Closed
Description
The problem
The count-down-loop
diagnostic does not warn all the time when the loop end cannot be reached due to it being less than the loop start.
-- warns
for i=10, 1 do end
-- does not warn
for i=100, 10, 1 do end
There is also no count-down-loop
equivalent for loops that count up but never reach the end of the loop:
-- does not warn
for i=1, -10 do end
--does not warn
for i=-10, 100, -1 do end
The solution
I think the count-down-loop
diagnostic should be renamed to loop-never-ends
. It can then be used for all of the cases above.
Originally posted by @carsakiller in #1362 (reply in thread)