# E4043

The struct field is defined or matched multiple times.

## Erroneous Example

```moonbit
struct S { a : Int }
let a : Int = match S::{ a: 2, a: 3 } {
  { a: 2, a: 3 } => 4
  _ => 5
}
```

The example above tries to:

1. Create a struct with the field `a` defined multiple times.
1. Destructure a struct with the field `a` matched multiple times.

... giving the following error on line 2:

```
The struct field a is defined several times.
```

... and the following error on line 3:

```
The struct field a is matched several times in this pattern.
```

## Suggestion

Make sure that the struct field is defined or matched only once:

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