# E0065

Warning name: `prefer_readonly_array`

Suggest `ReadOnlyArray` for read-only array literal.

This warning is emitted when the compiler can infer that an array literal is
used in a read-only way. Consider using `ReadOnlyArray` to better express
intent.

## Erroneous example

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

## Suggestion

Annotate the array literal as `ReadOnlyArray`:

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