# E4197

Compiler diagnostic name: `cannot_match_struct_constr`.

A struct constructor is a function, not a pattern constructor. It can be called
to create a value, but it cannot be used in a `match` pattern.

## Erroneous example

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

## Suggestion

Read the struct fields directly, or use another pattern that does not call the
constructor function.

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