Closed

Description
I'm trying to use pattern matching with fixed-size vectors, like this:
fn main() {
match [3, 5] {
[a, b] => println("ok")
};
}
However, this doesn't compile (I'm using 0.6 on Windows):
error: non-exhaustive patterns: vectors of length 0 not covered
After adding a wildcard the program compiles...
fn main() {
match [3, 5] {
[a, b] => println("ok"),
_ => ()
};
}
... which I think it shouldn't, since that last pattern is (or should be) unreachable. When replacing the fixed-size vector with a tuple, it certainly is:
fn main() {
match (3, 5) {
(a, b) => println("ok"),
_ => ()
};
}
error: unreachable pattern
Metadata
Metadata
Assignees
Labels
No labels