# E0052

Warning name: `unused_loop_variable`

A loop variable is not updated in loop.

When a loop variable is not updated, this could be a potential bug that you have
forgotten to update it, leading to an infinite loop.

## Erroneous example

```{literalinclude} /sources/error_codes/0052_error/top.mbt
:language: moonbit
```

## Suggestion

There are multiple ways to fix this warning:

- If this variable is indeed constant during the loop, you can remove it from
  the initialization and make it constant
- If your code depends on change of the variable, you should update it somewhere
  in the loop.

```{literalinclude} /sources/error_codes/0052_fixed/top.mbt
:language: moonbit
```