# E4113

Constructor has no field with the given name.

This error occurs when trying to access a field that doesn't exist in a
constructor pattern. In MoonBit, when pattern matching with constructors that
have named fields, you can only access fields that were defined in the
constructor's declaration.

This commonly happens when:

- Misspelling a field name
- Trying to access a field that exists in a different constructor
- Trying to access a field that was removed or renamed in the type definition

## Erroneous example

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

## Suggestion

To fix this error, you can either:

- add the missing field to the constructor

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

- remove the incorrect field access
