- Error
- Reported by the type checker
TS4104
The type '{0}' is 'readonly' and cannot be assigned to the mutable type '{1}'.
A readonly array or tuple is passed where a mutable one is expected. Accept a readonly type, or pass a copy.
What it means
A readonly array or tuple can't be assigned to a mutable array type, because code holding the mutable type could then change it. In ts-r-check this text appears as an indented line under an assignability error such as TS2322 (for example when assigning a readonly number[] to a number[] variable), not as a diagnostic of its own.
How to fix
- Make the target readonly too (
readonly number[]) if it only reads. - Or pass a copy:
[...fixed].