# E4214

Compiler diagnostic name: `cannot_extend_non_extensible_enum`.

Only `extenum` declarations can be extended.

Regular `enum` declarations are closed: all of their constructors must appear in
the original declaration. To add constructors later, declare the type as
`extenum` from the start.

## Erroneous example

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

The code tries to extend a regular `enum`.

## Suggestion

Declare the type as `extenum` before extending it.

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