# E0070

Warning name: `deprecated_for_in_method`

Deprecated method name for `for .. in` iteration.

MoonBit now looks for `iter` or `iter2` when a value is used as the source of a
`for .. in` loop. The old method names `iterator` and `iterator2` still work for
now, but they are deprecated.

## Erroneous example

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

## Suggestion

Rename `iterator` to `iter`, or `iterator2` to `iter2`.

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