Rellum Rellum

S0147: array pattern does not match scrutinee

Generated from rellum-diagnostics/src/db.rs.

Explanation

Array patterns can only destructure array values. They perform an exact runtime length check before binding element sub-patterns.

Common causes

Canonical fixes

Before:

match text { [a, b] => a }

After:

match chars(text) { [a, b] => a }

Before:

match values { [a, b] => a + b }

After:

match values { [a, b] => a + b _ => 0 }

Code example

match text { [a, b] => a }