A pattern was expected (a match arm, a clause parameter, the left side of let) but this
token can't start one. Patterns look like 0, "s", x, _, (a, b), [h, ..t],
Circle(r), User { name, .. } or "GET " + rest.
Wrong#
fn sign(n: int): int = match n {
=> 0
}Fixed#
fn sign(n: int): int = match n {
0 => 0
_ => 1
}Common causes#
- A match arm with the pattern left out.
- An expression where a pattern belongs:
n + 1 => ...; use a guardx when x > 0 => .... - A string-prefix pattern with a literal after
+:"a" + "b"; bind a name instead.