Error codes

E0263: an is pattern can't bind names

In a terminal: auk explain E0263 prints this page.

On this page

x is pat is a bool test: it can't bind variables, because they'd only exist when the test succeeded. Use _ in the pattern, or a match/let ... else to get the values.

Wrong#

auk
fn has(x: int?): bool = x is some(y)

Fixed#

auk
fn has(x: int?): bool = x is some(_)

Common causes#

  • Using is like Rust's if let: write match x { some(y) => ..., none => ... }.
  • Struct field shorthand in an is pattern: write P { name: _, .. }.

Stuck on a word? Try the glossary. Got a compiler error? Look up its code. Improve this page