#E0101: wrong number of fields in a pattern
A tuple or variant pattern has more or fewer parts than the value. Match each part, or use .. for the rest.
nabi
let t = (1, 2, 3);
let (a, b) = t;
error[E0101]: tuple destructure length mismatch: pattern has 2 elements, value has 3 --> main.nabi:2:1 | 2 | let (a, b) = t; | ^^^
Match every part, or use .. for the rest:
nabi
let t = (1, 2, 3);
let (a, ..) = t;
println(f"{a}");
1
Related: E0100 pattern does not fit the value's type, E0104 invalid rest pattern
Found a mistake? Edit this page on GitHub. Last updated