Error code E0416

An identifier is bound more than once in a pattern.

Erroneous code example:

match (1, 2) {
    (x, x) => {} // error: identifier `x` is bound more than once in the
                 //        same pattern
}
Run

Please verify you didn’t misspell identifiers’ name. Example:

match (1, 2) {
    (x, y) => {} // ok!
}
Run

Or maybe did you mean to unify? Consider using a guard:

match (A, B, C) {
    (x, x2, see) if x == x2 => { /* A and B are equal, do one thing */ }
    (y, z, see) => { /* A and B unequal; do another thing */ }
}
Run

Back to list of error codes