# E0036

Warning name: `loop_label_shadowing`

The loop label name shadows a label that is already in scope.

Loop labels must be unique within their scope. When a label name is reused
within a nested scope, it shadows the outer label, which can lead to confusion
about which loop is being referenced by `break` or `continue` statements.

This warning helps prevent bugs that could occur when breaking or continuing to
the wrong loop level due to label shadowing. It's recommended to use distinct,
descriptive label names for different loops to make the code's intent clear.

## Erroneous example

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

## Suggestion

Use distinct, descriptive label names for different loops to make the code's
intent clear.

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