# E4173

Compiler diagnostic name: `invalid_value_type_attr`.

Invalid `#valtype` declaration.

`#valtype` asks the compiler to represent a type as a value type. Value-type
fields must be immutable, so a declaration with a mutable field is rejected.

## Erroneous example

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

The field `value` is mutable.

## Suggestion

Make the field immutable, or remove `#valtype` if the type needs in-place
mutation.

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