# E4219

Compiler diagnostic name: `invalid_export_name`.

The `#export_name` attribute is invalid. MoonBit currently requires exported
names to be unique valid C symbol identifiers for every backend. The attribute
may be used only on public, non-generic function definitions without optional
arguments in a foreign-library package.

```{warning}
Known compiler issue: `#export_name` currently applies its C-symbol-identifier
restriction to every backend. WebAssembly export names are UTF-8 strings and
are not limited to C identifiers.
```

## Erroneous example

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

## Suggestion

Use a valid symbol name and declare the package as a foreign library with
`pkgtype(kind: "foreign_library")`.

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